View source: R/validate_types.R
validate_types | R Documentation |
This function checks the type of variables in a safeframe
against
accepted classes. Only checks the type of provided variables and ignores
those not provided.
validate_types(x, ...)
x |
a |
... |
< |
A named list
.
validate_tags()
to perform a series of checks on variables
validate_safeframe()
to combine validate_tags
and validate_types
x <- make_safeframe(cars,
mph = "speed",
distance = "dist"
)
x
## the below would issue an error
## note: tryCatch is only used to avoid a genuine error in the example
tryCatch(validate_types(x), error = paste)
## to allow other types, e.g. gender to be integer, character or factor
validate_types(x, mph = "numeric", distance = c(
"integer",
"character", "numeric"
))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.