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
As a part of the improved NA handling I would be very glad for a simpler & cleaner way for adding new NA values to a factor.
> x <- factor(1:3) > fct_c(NA, x) Error: All elements of `...` must be factors
The following works, but it looks less "tidy":
> fct_c(factor(NA), x) [1] <NA> 1 2 3 Levels: 1 2 3
Thanks! Balint
The text was updated successfully, but these errors were encountered:
You can do that (and much more) with vctrs::vec_c():
vctrs::vec_c()
vctrs::vec_c(NA, factor(1:3)) #> [1] <NA> 1 2 3 #> Levels: 1 2 3
Created on 2020-02-21 by the reprex package (v0.3.0)
I think at some point we'll eventually retire fct_c() in favour of this function.
fct_c()
Sorry, something went wrong.
No branches or pull requests
As a part of the improved NA handling I would be very glad for a simpler & cleaner way for adding new NA values to a factor.
The following works, but it looks less "tidy":
Thanks!
Balint
The text was updated successfully, but these errors were encountered: