tidyverse / forcats

🐈🐈🐈🐈: tools for working with categorical variables (factors)
https://forcats.tidyverse.org/
Other
553 stars 126 forks source link

Assigning a level to NULL in fct_collapse does not remove it.... #349

Closed mosesotieno closed 10 months ago

mosesotieno commented 1 year ago

Please briefly describe your problem and what output you expect. If you have a question, please don't use this form. Instead, ask on https://stackoverflow.com/ or https://community.rstudio.com/.

Please include a minimal reproducible example (AKA a reprex). If you've never heard of a reprex before, start by reading https://www.tidyverse.org/help/#reprex.

Brief description of the problem

# insert reprex here
x <- factor(c("apple", "bear", "banana", "dear"))
fct_collapse(x, NULL = "apple", fruit = "banana")
hadley commented 10 months ago

I'm not sure why you expect that, but that's not what fct_collapse() does.