Fix: only call replace_na(., 0) on numeric columns#195
Merged
martinctc merged 1 commit intoNov 20, 2021
Conversation
Member
|
Thank you @DavisVaughan - will review this change soon as I can and push a new version to CRAN. |
replace_na(., 0) on numeric columnsreplace_na(., 0) on numeric columns
martinctc
approved these changes
Nov 20, 2021
Member
|
@DavisVaughan - can confirm that these changes have been merged and pushed to CRAN, in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We are updating
tidyr::replace_na()to utilize the vctrs package, and that results in slightly stricter / more correct type conversions. See tidyverse/tidyr#1219We noticed in revdeps that this package broke. An easy way to see this is by installing the above mentioned PR and running:
The problem boils down to the fact that you are calling
mutate_all(df, ~replace_na(., 0))on adfthat has a mixture of character and numeric columns. Notably,PersonIdandgroupare character columns, and you can no longer use a numeric0as a replacement value for these.It seems like you probably just wanted to replace NAs in numeric columns, so this PR changes to a
mutate()call that targets only numeric columns.We would greatly appreciate if you could merge this PR and submit a patch release of your package to CRAN so we can send tidyr in!