Is NULL, NA, "" or 0 length

is_empty(x)

Arguments

x

object to be tested

Value

TRUE if object is NULL, NA, "" or length 0; logical vector for objects of length > 1

Examples

is_empty(c(NA, "a", ""))
#> [1] TRUE FALSE TRUE
is_empty(NULL)
#> [1] TRUE
is_empty(character())
#> [1] TRUE