R/categorical.R
is_categorical.Rd
Check, if vector is categorical, i.e. if is logical, factor, character or integer
is_categorical(x)
A vector of arbitrary type
Logical value
is_categorical(c(TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE))
#> [1] TRUE
is_categorical(1:10)
#> [1] TRUE
is_categorical((1:10) + 0.1)
#> [1] FALSE
is_categorical(as.factor(c("Ferrari", "Lamborghini", "Porsche", "McLaren", "Koenigsegg")))
#> [1] TRUE
is_categorical(c("Ferrari", "Lamborghini", "Porsche", "McLaren", "Koenigsegg"))
#> [1] TRUE