stopif: Stop execution if condition is TRUE

View source: R/Stringendo.R

stopifR Documentation

Stop execution if condition is TRUE

Description

The stopif() function stops the execution if the condition is TRUE. It is the opposite of stopifnot(), which stops if the condition is not TRUE. This function is useful to increase clarity in the code by removing double negations.

Usage

stopif(...)

Arguments

...

Logical conditions to be checked. Each condition must evaluate to a logical vector. Default: none. Named arguments will be used as error messages.

Value

The function stops execution if any condition evaluates to TRUE.

Examples

stopif(6 < 4, 6 > 5)
stopif("custom message" = 6 > 5)


vertesy/Stringendo documentation built on Nov. 10, 2024, 4:35 a.m.