fct_relevel

Move selected levels to the front

Explicitly reorders a factor by moving named levels ahead of the remaining levels.

Parameters

Returns

A factor vector with selected levels moved.

Examples

fct_relevel(fct, "c", "a")
fct_relevel(fct, "high", after = 2)