We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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 can I use validate to check for
validate
Thank you very much!
The text was updated successfully, but these errors were encountered:
I don't know for the first two points but to check whether you have unwanted columns, you can use names(.) in the rule:
names(.)
library(validate) test <- data.frame(var1 = c(1, NA), var2 = c(2, NA), foobar = c("a", "b"), var1.x = 1:2) rules <- validator( length(grep("\\.x$", names(.))) == 0, ! "foobar" %in% names(.) ) confront(test, rules) |> summary() #> name items passes fails nNA error warning #> 1 V1 1 0 1 0 FALSE FALSE #> 2 V2 1 0 1 0 FALSE FALSE #> expression #> 1 length(grep("\\\\.x$", names(.))) == 0 #> 2 !"foobar" %vin% names(.)
I often use the one that checks that no variable name ends with .x since it's usually the sign that a join produced duplicated variable.
.x
Sorry, something went wrong.
No branches or pull requests
How can I use
validate
to check forThank you very much!
The text was updated successfully, but these errors were encountered: