fct_expand {forcats} | R Documentation |
Add additional levels to a factor
fct_expand(f, ...)
f |
A factor. |
... |
Additional levels to add to the factor. Levels that already exist will be silently ignored. |
f <- factor(sample(letters[1:3], 20, replace = TRUE)) f fct_expand(f, "d", "e", "f") fct_expand(f, letters[1:6])