Check if an object inherits one (or more) of a vector classes.

some_type(
    object,
    types
)

Arguments

object

Any R object.

types

A character vector of classes to test against.

Value

A logical indicator

Author

Alex Zajichek

Examples

#Columns of a data frame
heart_disease %>%
    purrr::map_lgl(
        some_type,
        types = c("numeric", "logical")
    )
#>                   Age                   Sex             ChestPain 
#>                  TRUE                 FALSE                 FALSE 
#>                    BP           Cholesterol            BloodSugar 
#>                  TRUE                  TRUE                  TRUE 
#>             MaximumHR ExerciseInducedAngina          HeartDisease 
#>                  TRUE                 FALSE                 FALSE