Thanks for this great package! I'm wondering though whether there would be any possibility of integrating features of fct_other into the fct_collapse function?
I currently need to recode a factor by collapsing a targeted set of levels (say c("A", "B", "C", "D", "E")) into new levels (say c("AB", "CDE")) and I want to recode all non-targeted levels (which usually is quite a long set of levels to manually specify, e.g. all other letters of the alphabet) into an "other" category. In other words: I'ld like fct_collapse to have an additional argument (similar to fct_other's other_level argument) that, when specified, automatically identifies all non-targeted levels (i.e. those not specified in any of the vectors, which in fct_other would be specified in the drop argument) and collapses these into a category with level name specified in this argument.
This feature would be quite helpful, because the only solution I can think of now is quite cumbersome. That is, I have to manually specify all new (collapsed) factor level names (entered in the fct_collapse call) in the keep argument of fct_other, while I assume these could easily be internally identified automatically in the fct_collapse function.
Thanks for this great package! I'm wondering though whether there would be any possibility of integrating features of
fct_otherinto thefct_collapsefunction?I currently need to recode a factor by collapsing a targeted set of levels (say
c("A", "B", "C", "D", "E")) into new levels (sayc("AB", "CDE")) and I want to recode all non-targeted levels (which usually is quite a long set of levels to manually specify, e.g. all other letters of the alphabet) into an"other"category. In other words: I'ld likefct_collapseto have an additional argument (similar tofct_other'sother_levelargument) that, when specified, automatically identifies all non-targeted levels (i.e. those not specified in any of the vectors, which infct_otherwould be specified in thedropargument) and collapses these into a category with level name specified in this argument.This feature would be quite helpful, because the only solution I can think of now is quite cumbersome. That is, I have to manually specify all new (collapsed) factor level names (entered in the
fct_collapsecall) in thekeepargument offct_other, while I assume these could easily be internally identified automatically in thefct_collapsefunction.