isEmpty {bbnet} | R Documentation |
This function determines whether the provided object is empty.
isEmpty(x)
x |
The object to check for emptiness. |
isEmpty()
checks if the given object, x
, has a length of 0,
indicating that it is empty. It can be used with various types of objects
in R, including vectors, lists, and data frames.
A logical value: TRUE
if the object is empty, FALSE
otherwise.
# Check an empty vector
isEmpty(c())
# Check a non-empty vector
isEmpty(c(1, 2, 3))
# Check an empty list
isEmpty(list())
# Check a non-empty list
isEmpty(list(a = 1, b = 2))
# Check an empty data frame
isEmpty(data.frame())
# Check a non-empty data frame
isEmpty(mtcars)