Learn R Programming

Ecfun (version 0.1-4)

missing0: Missing or length 0

Description

TRUE if x is missing or if length(x) is 0.

Usage

missing0(x)

Arguments

x
a formal argument as for missing

Value

Details

Only makes sense called from within another function

See Also

missing

Examples

Run this code
tstFn <- function(x)missing0(x)
# missing 
stopifnot(
all.equal(tstFn(), TRUE)
)

# length 0 
stopifnot(
all.equal(tstFn(logical()), TRUE)
)

# supplied 
stopifnot(
all.equal(tstFn(1), FALSE)
)

Run the code above in your browser using DataLab