rename_factor {tidytidbits} | R Documentation |
Rename a factor.
Description
Renames the levels of a factor.
Usage
rename_factor(.f, ..., reorder = F)
Arguments
.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 |
Value
A renamed and reordered factor
See Also
rename_reorder_factor
, order_factor_by
,
forcats::fct_recode
, forcats::fct_relevel
[Package tidytidbits version 0.3.2 Index]