We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Imagine a factor without NAs on which you call fct_na_value_to_level().
fct_na_value_to_level()
Formely, fct_explicit_na() did absolutely nothing in such case:
fct_explicit_na()
letters[1:3] %>% factor %>% fct_explicit_na('x') [1] a b c Levels: a b c
Now, fct_na_value_to_level() adds a level for NA value even if it is not need:
letters[1:3] %>% factor %>% fct_na_value_to_level('x') [1] a b c Levels: a b c x
So, simple replacement (fct_na_value_to_level for fct_explicit_na) breaks existing code sometimes.
fct_na_value_to_level
fct_explicit_na
Ideally, fct_na_value_to_level() could behave just like fct_explicit_na() did. Or, at least warning message should inform somehow about above case.
The text was updated successfully, but these errors were encountered:
Reprex
library(forcats) letters[1:3] %>% factor %>% fct_na_value_to_level('x') #> [1] a b c #> Levels: a b c x
Created on 2023-02-27 with reprex v2.0.2
Sorry, something went wrong.
No branches or pull requests
Imagine a factor without NAs on which you call
fct_na_value_to_level()
.Formely,
fct_explicit_na()
did absolutely nothing in such case:Now,
fct_na_value_to_level()
adds a level for NA value even if it is not need:So, simple replacement (
fct_na_value_to_level
forfct_explicit_na
) breaks existing code sometimes.Ideally,
fct_na_value_to_level()
could behave just likefct_explicit_na()
did. Or, at least warning message should inform somehow about above case.The text was updated successfully, but these errors were encountered: