failIfNot | R Documentation |
This is basically stopifnotbase, but instead of stopping it returns TRUE. The following descriptions is adapted from stopifnotbase: If any of the expressions in ... are not all valid, then instead of stopping a TRUE is returned and an error message is printed indicating the first of the elements of ... which were not true.
failIfNot(...)
... |
any number of (logical) R expressions, which should evaluate to TRUE |
Returns TRUE if the provided expressions are not met
x <- 0
msg <- failIfNot(x > 3)
print(msg)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.