Renames the levels of a factor.
rename_factor(.f, ..., reorder = 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.
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