Change order of levels
Keep the values of the levels the same, but change their order. These are particularly useful for models, tables, and visualisations.
|
|
fct_relevel()
|
Reorder factor levels by hand |
|
fct_inorder() fct_infreq() fct_inseq()
|
Reorder factors levels by first appearance, frequency, or numeric order. |
|
fct_reorder() fct_reorder2() last2()
|
Reorder factor levels by sorting along another variable |
|
fct_shuffle()
|
Randomly permute factor levels |
|
fct_rev()
|
Reverse order of factor levels |
|
fct_shift()
|
Shift factor levels to left or right, wrapping around at end |