Throw error if condition false
Arguments
- cond
Logical test
- msg
Error message to be displayed if
cond == FALSE
- A
values to format
msg
if the latter contains C-style formatting commands. formatted as parsable
Examples
minVal <- 7
x <- 26
assert(minVal < x) # should return nothing
maxVal <- 13
if (FALSE) {
assert((minVal < x) && (x < maxVal))
assert(x == "a", "x is %s", class(x))
}