assert()
is a drop-in replacement for stopifnot()
that supports more
informative error messages.
Details
If any of the expressions defined in ...
are TRUE
, stop()
is called,
producing an error message indicating the first expression which was not
TRUE
.
Examples
assert(
is.atomic("example"),
is.character("example")
)