validate_tags {safeframe} | R Documentation |
Checks the tags of a safeframe object
Description
This function evaluates the validity of the tags of a safeframe
object by
checking that: i) tags are present ii) tags is a list
of character
or
NULL
values.
Usage
validate_tags(x)
Arguments
x |
a |
Value
If checks pass, a safeframe
object; otherwise issues an error.
See Also
validate_types()
to check if tagged variables have
the right classes
Examples
## create a valid safeframe
x <- cars |>
make_safeframe(
mph = "speed",
distance = "dist"
)
x
## the below issues an error as safeframe doesn't know any defaults
## note: tryCatch is only used to avoid a genuine error in the example
tryCatch(validate_safeframe(x), error = paste)
## validation requires you to specify the types directly
validate_safeframe(x,
mph = c("integer", "numeric"),
distance = "numeric"
)
[Package safeframe version 1.0.0 Index]