Learn R Programming

Ecfun (version 0.3-2)

missing0: Missing or length 0

Description

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

Usage

missing0(x)

Value

logical: TRUE if x is

missing or if length(x) is 0.

Arguments

x

a formal argument as for missing

Author

Spencer Graves

Details

Only makes sense called from within another function

See Also

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