-
Notifications
You must be signed in to change notification settings - Fork 15
Reorder
Cghlewis edited this page Oct 14, 2022
·
15 revisions
Reordering can refer to reordering columns in a data frame (say for example to more easily access or refer to columns). Or it can refer to reordering value levels of a variable (in the case of a factor). We can also sort our data (reorder rows) ascending or descending.
Main functions used in examples
Package | Functions |
---|---|
dplyr | relocate(); select(); arrange() |
forcats | fct_relevel() |
labelled | to_factor() |
Other functions used in examples
Package | Functions |
---|---|
base | levels() |
utils | str() |
dplyr | mutate(); pull() |
tidyselect | everything(); all_of() |
Resources