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

Name of object defined in x. Not intended to be used directly.

Value

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

Note

Updated 2019-10-04.

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: 'x' is not any of: character, data.frame.