powered by
Reorder factors levels by first appearance, frequency, or numeric order.
fct_inorder(f, ordered = NA)fct_infreq(f, ordered = NA)fct_inseq(f, ordered = NA)
fct_infreq(f, ordered = NA)
fct_inseq(f, ordered = NA)
A factor
A logical which determines the "ordered" status of the output factor. NA preserves the existing status of the factor.
NA
# NOT RUN { f <- factor(c("b", "b", "a", "c", "c", "c")) f fct_inorder(f) fct_infreq(f) fct_inorder(f, ordered = TRUE) f <- factor(sample(1:10)) fct_inseq(f) # }
Run the code above in your browser using DataLab