failIfNot: Ensure the Truth of R Expressions and returns TRUE if the...

failIfNotR Documentation

Ensure the Truth of R Expressions and returns TRUE if the expressions are not met.

Description

This is basically stopifnotbase, but instead of stopping it returns TRUE. The following descriptions is adapted from stopifnotbase: If any of the expressions in ... are not all valid, then instead of stopping a TRUE is returned and an error message is printed indicating the first of the elements of ... which were not true.

Usage

failIfNot(...)

Arguments

...

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

Value

Returns TRUE if the provided expressions are not met

Examples

x <- 0
msg <- failIfNot(x > 3)
print(msg)

AlexanderLyNL/bstats documentation built on Sept. 11, 2023, 4:10 p.m.