Validate Value(s)
validate.RdValidate values and turn them into item(s).
Details
This function does not accept the data.model element of the config list as an input.
It should be turned into a data.frame first, using yaml_to_dm().
data.model should contain the following columns:
"name", "type", "default", "class.arg", "values".
In case the data.model values column contains instruction that require
data-masking, items will be used as a context to evaluate those instructions.
Examples
if (FALSE) { # \dontrun{
# create config
config <- design(project = "test", item = "foo") |>
extend(item = "foo",
attribute = list(name = "name", type = "character"),
attribute = list(name = "quantity", type = "numeric"))
# values
values <- list(name = c("Banana", "Mango"), quantity = c(1, 12))
# call function
validate(values, data.model = yaml_to_dm(config, "name", "type", "default", "class.arg", "values"))
} # }