Recipe step for collapsing factor levels

Hi all
I am looking for a recipes::step_* function, which allows me to collapse manually specified factor levels into a single level, just like forcats::fct_collapse. Recipes::step_other is the closest I have come to finding such a function, however, rather than collapsing by frequency of occurrence, I would like to collapse manually specified levels based on domain knowledge.

Thanks in advance!

EDIT: using step_mutate() with fct_collapse seems to work well

That's exactly what I would use.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.