rename_factor | R Documentation |
Renames the levels of a factor.
rename_factor(.f, ..., reorder = F)
.f |
A factor or vector (if .f is not yet a factor, it is made one) |
... |
Dictionaryish arguments, named by old level, value is new level ("old level" = "new level"). You can pass single named arguments, or named vectors or named lists, which will be spliced. |
reorder |
Logical: If True, the levels will additionally be reordered in the order of first appearance in the arguments |
A renamed and reordered factor
rename_reorder_factor
, order_factor_by
,
forcats::fct_recode
, forcats::fct_relevel
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.