Skip to contents

This utility function returns TRUE if the input is NULL, has length zero, or is an NA of length one. Otherwise returns FALSE.

Usage

is.nulla(x)

Arguments

x

Any R object.

Value

A logical scalar: TRUE if x is considered "null-like", otherwise FALSE.

Examples

is.nulla(NULL)
#> [1] TRUE
is.nulla(NA)
#> [1] TRUE
is.nulla(character(0))
#> [1] TRUE
is.nulla(1)   # FALSE
#> [1] FALSE