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

DOn't check type of NA values #497

Merged
merged 1 commit into from
May 4, 2024
Merged

DOn't check type of NA values #497

merged 1 commit into from
May 4, 2024

Conversation

strengejacke
Copy link
Member

@strengejacke strengejacke commented May 4, 2024

library(datawizard)
data(mtcars)
x1 <- recode_into(
  mpg > 10 ~ 1,
  gear == 5 ~ NA_real_,
  data = mtcars
)
#> Warning: Several recode patterns apply to the same cases. Some of the already
#>   recoded cases will be overwritten with new values again (e.g. pattern 2
#>   overwrites the former recode of case 27).
#>   Please check if this is intentional!
# this didn't work before
x2 <- recode_into(
  mpg > 10 ~ 1,
  gear == 5 ~ NA,
  data = mtcars
)
#> Warning: Several recode patterns apply to the same cases. Some of the already
#>   recoded cases will be overwritten with new values again (e.g. pattern 2
#>   overwrites the former recode of case 27).
#>   Please check if this is intentional!
identical(x1, x2)
#> [1] TRUE

Created on 2024-05-04 with reprex v2.1.0

@strengejacke strengejacke merged commit 93ae67a into main May 4, 2024
22 of 27 checks passed
@strengejacke strengejacke deleted the relax_recode_into_NA branch May 4, 2024 10:00
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

Successfully merging this pull request may close these issues.

1 participant