similarly to fct_lump() .
library(forcats)
x <- letters[c(1:3, 2)]
w <- c(4, 1, 3, 1)
x
#> [1] "a" "b" "c" "b"
w
#> [1] 4 1 3 1
fct_infreq(x)
#> [1] a b c b
#> Levels: b a c
fct_infreq(x, w = w)
#> Error in fct_infreq(x, w = w): unused argument (w = w)
# Should behave like:
fct_reorder(x, w, sum, .desc = TRUE)
#> [1] a b c b
#> Levels: a c b
Created on 2020-04-27 by the reprex package (v0.3.0)
similarly to
fct_lump().Created on 2020-04-27 by the reprex package (v0.3.0)