MomX / Momocs

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

Row-wise combine of Coe objects #203

Closed MikePapaWhisky closed 4 years ago

MikePapaWhisky commented 6 years ago

Any word on the implementation (as hinted in ?combine) of row-wise, or preferably choice between row-wise and column-wise, combining of Coe objects? Would be useful when calculating mshapes (which must be done on Coe) are then combining mshapes with other shapes.

_E.g. might expect the following to re-create bot_coe_


bot_coe <- bot %>% efourier(nb.h = 2, norm = F)
bot_coe_whi <- bot_coe %>% Momocs::filter(type == "whisky")
bot_coe_bee <- bot_coe %>% Momocs::filter(type == "beer")
Momocs::combine(bot_coe_whi, bot_coe_bee)```
vbonhomme commented 6 years ago

soon, eg before the release of MomX, within a month I'd say

vbonhomme commented 6 years ago

any suggestion for self speaking names ? possibly not including c or combine ?

MikePapaWhisky commented 6 years ago

Guess it depends on whether 'combine row-wise' and 'combine column-wise' are going to be two separate functions, or argument options of a single function. Assuming the former...

I haven't found any use for 'combine column-wise' (not to suggest I don't think there are perfectly worthwhile ones), so its tricky to think of a succinct name for it.

For 'combine row-wise' the most obvious suggestion for me would be merge. Otherwise, and in Tidyverse parlance, bind_rows would be the nearest comparison. It would be handy if differences in $fac between the two objects being merged could be handled, making it something like dplyr::full_join. Maybe join?

vbonhomme commented 6 years ago

Based on [this], what do you think of:

what do your English ears/brain/heart think of that?

MikePapaWhisky commented 6 years ago

(Yeah, silly of me to forget use of column-wise combine).

Both are essentially 'to concatenate', though not sure which direction more appropriate for that word.

Like tie, but stitch might be better ('tie' has a plethora of meanings in English). Also, though, maybe append (as you're appending data onto data).

couple is good too but might imply the two are kept separate. Other ideas hinge and unite/unify (both of imply bringing together similar things).

Discussed around office, append and unite preferred.

vbonhomme commented 6 years ago

append is also a R base function but sounds good. I think this could be just c (which is short for concatenate as well).

unite is nice but the contrary operation already exist in Momocs (dissolve). gather is already taken, what about assemble?

otherwise what do you think of superimpose and juxtapose. It's perfectly understood by frog people but do you guys use it a lot too? Pretty long though.


side comment, this conversation is a pretty good confirmation of this

MikePapaWhisky commented 6 years ago

juxtapose sounds good (you could have appose too) for the combine column-wise function - i.e. to place side-by-side.

'superimpose' not so good as means to place on top of each other, and these functions are for joining things together.

assemble doesn't feel right to me (lacks direction). How about its synonyms convene, accumulate or even `bunch'.

Whatever you think is best, frog ears are better than beef ears anyway.

vbonhomme commented 6 years ago

I think I'll let combine for column-wise and create a c method for row-wise

vbonhomme commented 4 years ago

Is now, natively, solved in Momocs2