check_list_mapping | R Documentation |
To be compatible with template, mapping should follow these rules:
only one value is mapped to a name
new can add new name with new value, not already in old
new cannot redefine a value with a new name (unless allow_override, not currently supported)
check_list_mapping(new, old, raise, only.errors = TRUE)
new |
list() |
old |
list() |
raise |
function(type, value, problem, message) |
only.errors |
only raise errors |
Overriding is allowed wraping the value with override
function
## Not run:
new = list("var1"="Q1", "var2"="Q2", "var3"="Q3", "var4"="Q1", "var5"="Q4")
old = list("var0"="Q0", "var1"="Q1", "var2"="Q4")
check_list_mapping(new, old, raise=raise)
# Returs list of errors
new = list("var1"="Q1", "var3"=override("Q2"))
old = list("var2"="Q2")
check_list_mapping(new, old, raise=raise) # Only throw warning
## End(Not run)
# The checks are transmitted to a provided function \code{\link{raise()}}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.