Fixes the issue of fct_lump_prop() when there are unused levels.
# original example--------------------------------
f <- factor(c("a", "a", "b", "c"), levels = c("a", "b", "c", "d"))
fct_lump_prop(f, prop = 0.25)
# [1] a a Other Other
# Levels: a Other
fct_lump_prop(f, prop = 0.25, w = rep(1, 4))
#[1] a a Other Other
#Levels: a Other
# Hadley's reprex-----------------------------
f <- factor(c("a", "b", "c"), levels = c("a", "b", "c", "d"))
fct_lump_prop(f, prop = 0.02, w = c(1,1,1))
#[1] a b c
#Levels: a b c d
# also-------------------------------------
fct_lump_min(f, min = 1, w = c(1,1,1))
# [1] a b c
# Levels: a b c Other
# previous output
# [1] a b c
# Levels: a b c d
Fixes the issue of
fct_lump_prop()
when there are unused levels.Closes #292