Checks the value's class type, which should match at least of the types given in any_expected_class_types.
Source:R/misc.R
check_type.Rd
Checks the value's class type, which should match at least of the types given in any_expected_class_types.
Examples
check_type(1, "numeric", 1) # TRUE
#> [1] TRUE
check_type("1", "numeric", 1) # FALSE
#> [1] FALSE
check_type(1, "numeric", 2) # FALSE
#> [1] FALSE
check_type("ABC", "character", 1) # TRUE
#> [1] TRUE
check_type("ABC", "character") # TRUE
#> [1] TRUE
check_type("ABC", "character", 2) # FALSE
#> [1] FALSE
check_type(c("ABC", "DEF"), "character", 2) # TRUE
#> [1] TRUE
check_type(1.1, c("numeric", "double")) # TRUE
#> [1] TRUE
check_type(1.1, c("numeric", "double"), 1) # TRUE
#> [1] TRUE
check_type(matrix(1:9, nrow=3), "matrix") # TRUE
#> [1] TRUE
check_type(data.frame(a=1:3, b=4:6), c("something", "data.frame")) # TRUE
#> [1] TRUE