Learn R Programming

usefun (version 0.5.2)

is_empty: Is object empty?

Description

A function to test whether an object is empty. It checks the length of the object, so it has different behaviour than is.null.

Usage

is_empty(obj)

Value

a logical specifying if the object is NULL or not.

Arguments

obj

a general object

Examples

Run this code
# TRUE
is_empty(NULL)
is_empty(c())

# FALSE
is_empty("")
is_empty(NA)
is_empty(NaN)

Run the code above in your browser using DataLab