vector_allowed_values | R Documentation |
Checks if a vector contains values only out of a set of available options.
vector_allowed_values(v, allowed_values)
v |
the vector |
allowed_values |
a vector of allowed values |
## Not run:
# For assertion.
# Will fail if v contains any value that is not either 1, 2 or 3
assertthat::assert_that(qscheck::vector_allowed_values(v, c(1, 2, 3)))
# For check
if (qscheck::vector_allowed_values(v, c(1, 2, 3))) {
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.