Note
This document only provides a short reference. Please refer to the vignette for worked
examples. vignette("intro",package="validate")Local, transient assignment
The operator `:=' can be used to set up local variables (during, for example, validation) to save
time (the rhs of an assignment is computed only once) or to make your validation code more maintainable.
Assignments work more or less like common R assignments: they are only valid for statements coming after
the assignment and they may be overwritten. The result of computing the rhs is not part of a
confrontation with data.Groups
Often the same constraints/rules are valid for groups of variables.
validate allows for compact notation. Variable groups can be used in-statement
or by defining them with the := operator. validator( var_group(a,b) > 0 ) is equivalent to validator(G := var_group(a,b), G > 0) is equivalent to validator(a>0,b>0). Using two groups results in the cartesian product of checks. So the statement validator( f=var_group(c,d), g=var_group(a,b), g > f) is equivalent to validator(a > c, b > c, a > d, b > d)File parsing
Please see the vignette on how to read rules from and write rules to file: vignette("rule-files",package="validate")