Skip to contents

This function checks if a factor has length zero.

Usage

# S3 method for factor
is.empty(x)

Arguments

x

A factor object

Value

A logical value: TRUE if the factor is empty, FALSE otherwise

Examples

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