check_class | R Documentation |
Check an object against a vector of class names. Testing if they match any or all of the classes. For is_all_of, the object needs to be at least every class specified, but it can have addition classes and still pass the check.
is_one_of(x, classes)
is_any_of(x, classes)
is_all_of(x, classes)
x |
the object to check |
classes |
the vector of strings of class names |
boolean value for the result of the check
is_one_of(1, c("numeric", "logical")) # TRUE
is_one_of(1, c("character", "logical")) # FALSE
is_all_of(1, c("numeric", "logical")) # FALSE
is_all_of(tibble::tibble(), c("tbl", "data.frame")) # TRUE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.