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

how to check for NA in vectors? #186

Open
simonkolb opened this issue Aug 19, 2024 · 0 comments
Open

how to check for NA in vectors? #186

simonkolb opened this issue Aug 19, 2024 · 0 comments

Comments

@simonkolb
Copy link

simonkolb commented Aug 19, 2024

Hello,

I might be missing something obvious, but I am failing to do a check of the following type:

data <- data.frame(A= c(NA,NA,2,2,1,1))
rules <- validate::validator(A %in% c(2, NA) )
out <- validate::confront(data, rules)
validate::aggregate(out, by='record')

validate is intepreting th NA in the vector incorrectly.

I need this functionality, since I am doing plausibility checks with hundreds of rules which consist of the type:

var %in% c(..., ..., NA)

Thanks

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