muststop: Test for an expression that should result in an error

Description Usage Arguments Value See Also Examples

View source: R/muststop.R

Description

This function tests the assertion that there is an error in the expression and therefore that evaluating it will generate an error condition.

Usage

1
muststop(expr, silent = TRUE)

Arguments

expr

Any R expression

silent

if FALSE, the error message will be reported.

Value

If an error is generated, the function returns the corresponding condition object; if not, then muststop() will itself generate an error.

See Also

stopifnot

Examples

1
muststop(sqrt("abc"))

SoDA documentation built on Oct. 28, 2020, 9:07 a.m.