R/is.empty.R
is.empty.factor.Rd
This function checks if a factor has length zero.
# S3 method for factor is.empty(x)
A factor object
A logical value: TRUE if the factor is empty, FALSE otherwise
fct1 <- factor(levels = c("A", "B")) is.empty(fct1) # Returns TRUE #> [1] TRUE fct2 <- factor(c("A", "B", "A")) is.empty(fct2) # Returns FALSE #> [1] FALSE