This discards the observations as well as the levels specified from a factor.
Arguments
- x
(factor
)
the original factor.
- discard
(character
)
levels to discard.
Value
A modified factor
with observations as well as levels from discard
dropped.
Examples
fct_discard(factor(c("a", "b", "c")), "c")
#> [1] a b
#> Levels: a b