Does the object belong to or inherit any of these classes?

isAny(x, classes, .xname = getNameInParent(x))

Arguments

x

Object.

classes

character. Object classes.

.xname

Not intended to be used directly.

Value

TRUE on success; FALSE on failure, with cause attribute set.

Examples

x <- 1L ## TRUE ==== isAny(x, classes = c("integer", "NULL"))
#> [1] TRUE
isAny(x, classes = c("numeric", "NULL"))
#> [1] TRUE
isAny(x, classes = c("atomic", "NULL"))
#> [1] TRUE
## FALSE ==== isAny(x, classes = c("character", "data.frame"))
#> [1] FALSE #> Cause of failure: #> x is not any of: character, data.frame.