x <- 1
class(x) <- c("a", "b")
check_class(x, c("a", "c"))
if (FALSE) {
check_class(x, c("c", "d"))
# customize error message with `glue::glue()` syntax
specific <- "Unbelievable! The first class of `{name}` is {feature[1]}."
check_class(x, c("c", "d"), specific = specific)
}
Run the code above in your browser using DataLab