| type_check_each | R Documentation |
Apply type_check to each element in a list of targets against a single
template. The template lookup table is built once and reused across every
target, amortising the hash-table construction.
type_check_each(
template,
targets,
with_cast = FALSE,
log_items = c("casts", "missing", "excess", "debug")[c(1, 3)]
)
template |
A named list to use as a template. |
targets |
A list of named lists/dataframes to check against the template. |
with_cast |
If true, edits each target instead of just checking types. |
log_items |
Which debug info to print. Mirrors |
A list of the targets, with their types appropriately cast. Names of targets are preserved.
type_check_each(
list("a" = character(0), "b" = integer(0)),
list(list("a" = 1, "b" = 2.5), list("a" = "x", "b" = 3L)),
TRUE, NULL
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.