R/reorder.R
fct_inorder.Rd
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)
f | A factor |
---|---|
ordered | A logical which determines the "ordered" status of the
output factor. |
#> [1] b b a c c c #> Levels: a b cfct_inorder(f)#> [1] b b a c c c #> Levels: b a cfct_infreq(f)#> [1] b b a c c c #> Levels: c b afct_inorder(f, ordered = TRUE)#> [1] b b a c c c #> Levels: b < a < c#> [1] 5 8 9 3 7 2 10 4 6 1 #> Levels: 1 2 3 4 5 6 7 8 9 10