Reorders levels in order of first appearance or frequency.
fct_inorder(f) fct_infreq(f)
f
A factor
f <- factor(c("b", "b", "a", "c", "c", "c")) f fct_inorder(f) fct_infreq(f)