forcats::fct_lump_n() with weights "overall"
Sometimes I want to summarize some categories which don’t have much impact on my analysis. So the best way to do this is using some of the forcats::fct_lump*()
functions.
But I often struggle to find the way using the weights to order the categories. That’s because the main use case of fct_lump()
is a vector of a factor containing several values and getting the most n
and the rest combined as “other”.