R/is.empty.R
is.empty.list.Rd
This function checks if a list has length zero.
# S3 method for list is.empty(x)
A list object
A logical value: TRUE if the list is empty, FALSE otherwise
lst1 <- list() is.empty(lst1) # Returns TRUE #> [1] TRUE lst2 <- list(a = 1, b = 2) is.empty(lst2) # Returns FALSE #> [1] FALSE