fct_drop | R Documentation |
This extends [forcats::fct_drop()] to natively work across a data.frame and replaces [base::droplevels()].
fct_drop(x, ...)
## S3 method for class 'data.frame'
fct_drop(x, ...)
## S3 method for class 'factor'
fct_drop(x, ...)
x |
Factor to drop unused levels |
... |
Other arguments passed down to method. |
mtcars |>
numchar2fct() |>
fct_drop()
mtcars |>
numchar2fct() |>
dplyr::mutate(vs = fct_drop(vs))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.