stopifnot: Backport of stopifnot for R versions < 4.0.0.

Description Usage Examples

View source: R/stopifnot.R

Description

See the original description in base::stopifnot.

Usage

1
stopifnot(..., exprs, exprObject, local = TRUE)

Examples

1
2
3
4
5
6
# get function from namespace instead of possibly getting
# implementation shipped with recent R versions:
bp_stopifnot = getFromNamespace("stopifnot", "backports")

m <- matrix(c(1, 3, 12, 1), 2, 2)
## Not run: bp_stopifnot("m must be symmetric" = m == t(m))

backports documentation built on Dec. 13, 2021, 5:08 p.m.