reorder_levels | R Documentation |
Order factor levels based on a subset of values (e.g., only female values, or only male values)
reorder_levels(f, v, index, choice)
f |
Character vector used as a factor variable |
v |
Numeric vector used to order the factor levels |
index |
Vector used to divide f and v into exactly 2 groups (e.g., Males, Females) |
choice |
The value of index to use to (e.g., Female) |
An character vector to be used in the level argument of factor()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.