validate icon indicating copy to clipboard operation
validate copied to clipboard

`validate::variables` returns R variables that are not columns of data

Open edwindj opened this issue 5 years ago • 1 comments

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"

edwindj avatar Feb 14 '20 10:02 edwindj

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"

edwindj avatar Feb 18 '20 09:02 edwindj