R/reorder.R
fct_inorder.Rd
This family of functions changes only the order of the levels.
fct_inorder()
: by the order in which they first appear.
fct_infreq()
: by number of observations with each level (largest first)
fct_inseq()
: by numeric value of level.
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 a#> [1] 1 2 3 #> Levels: 3 2 1fct_inseq(f)#> [1] 1 2 3 #> Levels: 1 2 3