isEmpty: Check if the provided object is empty

View source: R/error-checks.R

isEmptyR Documentation

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

# 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, ])

ospsuite.utils documentation built on March 18, 2022, 6:44 p.m.