if (FALSE) {
library(assertthat)
assert_that(c(1, 2) %all_in% c(0, 1, 2, 3, 4))
# TRUE
assert_that("a" %all_in% letters)
# TRUE
assert_that("A" %all_in% letters)
# Error: "A" is missing 1 element from letters: "A"
assert_that(1:10 %all_in% letters)
# Error: 1:10 is missing 10 elements from letters: 1L, 2L, 3L, ...
}
Run the code above in your browser using DataLab