library(validate)
rules <- validator( rule1 = z > 1
, rule2 = y > z
)
# rule1 is dropped, since it always is true
substitute_values(rules, list(z=2))
# you can also supply the values as separate parameters
substitute_values(rules, z = 2)
# you can choose to not add substituted values as a constraint
substitute_values(rules, z = 2, .add_constraints = FALSE)
rules <- validator( rule1 = if (gender == "male") age >= 18 )
substitute_values(rules, gender="male")
substitute_values(rules, gender="female")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.