You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to be able to override the fct_lump_*() functions with a keep argument, to avoid lumping particular levels into "Other".
For example, using fct_lump_prop(), I want to lump factors that occur <20% of the time, but I want to keep "A" no matter what.
xxx<-factor(c("A", "B", "B", "C", "C", "C", "C", "C", "C", "C"))
# Desired:
fct_lump_prop(xxx, 0.2, keep="A")
#> [1] A Other Other C C C C C C C #> Levels: A C Other
Adding the second part of the condition (levels(f) %in% keep) to the lvls_other() call as below would do it, I think:
I'd like to be able to override the
fct_lump_*()
functions with akeep
argument, to avoid lumping particular levels into "Other".For example, using
fct_lump_prop()
, I want to lump factors that occur <20% of the time, but I want to keep "A" no matter what.Adding the second part of the condition (
levels(f) %in% keep
) to thelvls_other()
call as below would do it, I think:The text was updated successfully, but these errors were encountered: