Learn R Programming

bazar (version 1.0.11)

stopif: Ensure that R expressions are false

Description

If any of the expressions in ... are not all FALSE, stop is called, producing an error message indicating the first of the elements of ... which were not false.

Usage

stopif(...)

Arguments

...

Any number of (logical) R expressions, which should evaluate to TRUE.

Value

(NULL if all statements in ... are FALSE.)

See Also

stopifnot from package base.

Examples

Run this code
# NOT RUN {
stopif(is.empty(c(2,1)), 4 < 3) # all FALSE
stopif(is.empty(numeric(0)))
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab