assert | R Documentation |
assert_all()
and assert_any()
are functions that require all or any of
the expressions in ...
to be TRUE
. They are more flexible versions of
stopifnot()
that also provide the conditioning
system benefits of abort()
. They are powered
(and generalized) by assert()
.
assert( ..., message = NULL, class = NULL, data = NULL, trace = NULL, parent = NULL, reduce = base::all ) assert_all( ..., message = NULL, class = NULL, data = NULL, trace = NULL, parent = NULL ) assert_any( ..., message = NULL, class = NULL, data = NULL, trace = NULL, parent = NULL )
... |
Unnamed expressions that describe the conditions to be tested |
message |
The message to display. Character vectors are
formatted with If a message is not supplied, it is expected that the message is
generated lazily through conditionMessage(). In
that case, |
class |
Subclass of the condition. This allows your users to selectively handle the conditions signalled by your functions. |
data |
Additional data to be stored in the condition object |
trace |
A |
parent |
A parent condition object created by |
reduce |
A function that takes a vector of logical values as an argument
and returns a single logical value. |
assert()
evaluates logical expressions and throws an error if the
conditions specified by reduce
are not met. It allows any combination of
logical conditions (not just "all TRUE
" or "any TRUE
") and provides the
conditioning system benefits of abort()
.
TRUE
if the assertions evaluate to TRUE
, otherwise an error
condition
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.