validate
validate copied to clipboard
`validate::variables` returns R variables that are not columns of data
validate::variables returns R variables that are not columns
data to be checked.
library(validate)
rules <- validator(A %in% letter[1:2])
variables(rules)
## [1] "A" "letter"
The following statement returns all variables mentioned in the rule set. For many purposes it is nicer that the function only returns the columns of the data to be checked (i.e. "x")
library(validate)
rules <- validator(x > ref$y)
variables(rules)
## [1] "x" "ref" "y"