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

Replace case_when() calls with case_match() #109

Open
egouldo opened this issue Aug 14, 2024 · 0 comments
Open

Replace case_when() calls with case_match() #109

egouldo opened this issue Aug 14, 2024 · 0 comments
Assignees
Labels
upkeep maintenance, infrastructure, and similar

Comments

@egouldo
Copy link
Owner

egouldo commented Aug 14, 2024

From ?dplyr::case_match():

# Setting `.default` to the original vector is a useful way to replace
# selected values, leaving everything else as is
case_match(y, NA ~ 0, .default = y)

This will avoid expressions on the RHS from evaluating and causing warning messages when all we want to do is replace selected values.

@egouldo egouldo added the upkeep maintenance, infrastructure, and similar label Aug 14, 2024
@egouldo egouldo added this to the Software Manuscript Submit milestone Aug 14, 2024
@egouldo egouldo self-assigned this Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upkeep maintenance, infrastructure, and similar
Projects
None yet
Development

No branches or pull requests

1 participant