stopifnot {loggit2} | R Documentation |
Conditional Stop Log Handler
Description
This function is identical to base R's stopifnot
,
but it includes logging of the exception message via loggit()
.
Usage
stopifnot(..., exprs, exprObject, local, .loggit = NA, echo = get_echo())
Arguments
... , exprs |
any number of { expr1 expr2 .... } Note that e.g., positive numbers are not |
exprObject |
alternative to |
local |
(only when |
.loggit |
Should the condition message be added to the log?
If |
echo |
Should the log entry (json) be echoed to |
See Also
Other handlers:
message()
,
stop()
,
warning()
Examples
## Not run:
stopifnot("This is a completely false condition" = FALSE)
stopifnot(5L == 5L, "This is a completely false condition" = FALSE, echo = FALSE)
## End(Not run)