Closed
Description
When calling fct_lump_prop with weights, and with a factor that has unused levels, I get the error:
Error in if (prop > 0 && sum(prop_n <= prop) <= 1) { :
missing value where TRUE/FALSE needed
Reprex:
f <- factor(c("a", "b", "c"), levels = c("a", "b", "c", "d"))
f <- fct_lump_prop(f, prop = 0.02, w = c(1,1,1))
Calling fct_drop() beforehand prevents the error.