Learn R Programming

ospsuite.utils (version 1.2.0)

isEmpty: Check if the provided object is empty

Description

Check if the provided object is empty

Usage

isEmpty(object)

Arguments

object

An object or an atomic vector or a list of objects.

Value

TRUE if the object is empty.

Examples

Run this code
# NOT RUN {
# empty list or data.frame
isEmpty(NULL)
isEmpty(numeric())
isEmpty(list())
isEmpty(data.frame())

# accounts for filtering of arrays and data.frame
df <- data.frame(x = c(1, 2, 3), y = c(4, 5, 6))
isEmpty(df)
isEmpty(df$x[FALSE])
isEmpty(df[FALSE, ])
# }

Run the code above in your browser using DataLab