Skip to contents

This function checks if a list has length zero.

Usage

# S3 method for list
is.empty(x)

Arguments

x

A list object

Value

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

Examples

lst1 <- list()
is.empty(lst1)  # Returns TRUE
#> [1] TRUE

lst2 <- list(a = 1, b = 2)
is.empty(lst2)  # Returns FALSE
#> [1] FALSE