assert | R Documentation |
A simpler and more efficient replacement for base::stopifnot()
.
As opposed to stopifnot()
, assert()
only works with a single (scalar) assertions.
assert(cond, ..., call = sys.call(-1))
cond |
|
... |
Either |
TRUE
on success
assert_all()
## Not run:
assert(1 == 1)
assert(1 == 2)
assert(1 == 2, "one is not ", "two")
assert(1 == 2, errorCondition("one is not two", class = "ObviousError"))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.