Description Usage Arguments Examples
View source: R/data_expectations.R
Check that values in a discrete or categorical vector are within a set of acceptable values
1 | expect_values_only_in(test_vector, correct_vector)
|
test_vector |
vector to test |
correct_vector |
vector of all acceptable values |
1 2 3 4 5 | expect_values_only_in(mtcars$cyl, c(2, 4, 6))
# Error in expect_values_only_in(mtcars$cyl, c(2, 4, 6)) :
# 8 value not found in list given
expect_values_only_in(mtcars$cyl, c(2, 4, 6, 8))
# [1] "all values expected...OK"
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.