Description Usage Arguments Examples
Validate objects
1 2 3 |
. |
Object to validate. |
... |
Input validation checks. |
error_class |
Character vector of the error subclass to signal if
validation fails. If |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # All assertions valid: data frame returned (invisibly)
validate(mtcars,
is.data.frame,
chk_all_map(is.numeric),
chk_gt(10, nrow(.)),
chk_has_names(c("mpg", "cyl")))
# Some assertions invalid: diagnostic error raised
## Not run:
validate(mtcars,
is.matrix,
chk_all_map(is.numeric),
chk_gt(1000, nrow(.)),
chk_has_name("cylinders"))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.