MomX / Momocs

:dove: Morphometrics using R
http://momx.github.io/Momocs/
52 stars 19 forks source link

Run efourier directly on coordinate within a dataframe #221

Closed JohnSal1 closed 3 years ago

JohnSal1 commented 3 years ago

I will start with a praise; it is a wonderful package that I only discovered few days ago. My issue: I have field within a dataframe (e.g., mydata[2,2]) that describe closed object coordinates in this format X Y, X1 Y1, … Xn Yn. How can I run the efourier directly on this field?

vbonhomme commented 3 years ago

Sth around mutate(yourdf, coef=map(yourcol, efourier)). Cant check im afk for a month All the best

Le mer. 11 août 2021 20:00, JohnSal1 @.***> a écrit :

I will start with a praise; it is a wonderful package that I only discovered few days ago. My issue: I have field within a dataframe (e.g., mydata[2,2]) that describe closed object coordinates in this format X Y, X1 Y1, … Xn Yn. How can I run the efourier directly on this field?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/MomX/Momocs/issues/221, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABECQFUPOHL27HRFR2NQ4HTT4K3DHANCNFSM5B7DQHYQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

JohnSal1 commented 3 years ago

Correcting my issue question, how to convert this closed object coordinates field to a list or a matrix of coordinates or a Out object so I can input them into the efourier command

vbonhomme commented 3 years ago

Out(yourdf$yourcol, select(yourdf, -yourcol))

Le jeu. 12 août 2021 16:10, JohnSal1 @.***> a écrit :

Correcting my issue question, how to convert this closed object coordinates field to a list or a matrix of coordinates or a Out object so I can input them into the efourier command

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/MomX/Momocs/issues/221#issuecomment-897672835, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABECQFS7VGGIEZLMDH5TQLTT4PI65ANCNFSM5B7DQHYQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

JohnSal1 commented 3 years ago

I am still struggling even in creating this Out object based on this simple code:

library(Momocs)

Obj1Fac <- as.data.frame(c("Temp"))
Obj1Matrix <- (matrix(1:10, ncol=2))
Obj1Matrix <- coo_close(Obj1Matrix)
Obj1 <- Out(Obj1Matrix, Obj1Fac) 

I get this Error in 1:k : NA/NaN argument

Why?

vbonhomme commented 3 years ago

Obj1matrix must be a list. See ?Out

Le jeu. 12 août 2021 20:44, JohnSal1 @.***> a écrit :

I am still struggling even in creating this Out object based on this simple code:

library(Momocs)

Obj1Fac <- as.data.frame(c("Temp")) Obj1Matrix <- (matrix(1:10, ncol=2)) Obj1Matrix <- coo_close(Obj1Matrix) Obj1 <- Out(Obj1Matrix, Obj1Fac)

I get this Error in 1:k : NA/NaN argument

Why?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/MomX/Momocs/issues/221#issuecomment-897882286, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABECQFTZNXAD44FKMTG2VB3T4QJCTANCNFSM5B7DQHYQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

JohnSal1 commented 3 years ago

Thanks