assert | R Documentation |
assert()
is a drop-in replacement for stopifnot()
that supports more
informative error messages.
assert(..., msg = NULL)
... |
Any number of R expressions that return |
msg |
|
If any of the expressions defined in ...
are TRUE
, stop()
is called,
producing an error message indicating the first expression which was not
TRUE
.
TRUE
on success, error on failure.
Updated 2021-10-08.
stopifnot()
.
assertthat::assert_that()
.
assertive.base::assert_engine()
.
checkmate::assert()
.
assert(
is.atomic("example"),
is.character("example")
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.