Skip to content
New issue

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

Allow multiple arguments to na_if #7651

Open
nalimilan opened this issue Feb 4, 2025 · 0 comments
Open

Allow multiple arguments to na_if #7651

nalimilan opened this issue Feb 4, 2025 · 0 comments

Comments

@nalimilan
Copy link

It's quite frequent to have to recode several distinct values to NA. So far the shortest solution I could find to do that is e.g. na_if(na_if(vec, 88), 99). if_else(vec %in% c(88, 99), NA_real_, vec) or case_match(vec, c(88, 99) ~ NA, .default=vec) are also possible but relatively verbose. Could it be allowed to pass multiple arguments to na_if so that one could write na_if(vec, 88, 99) instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant