stopifnot {loggit2}R Documentation

Conditional Stop Function Log Handler

Description

This function is identical to base R's stopifnot, but it includes logging of the exception message via loggit().

Usage

stopifnot(..., exprObject, local, .loggit = TRUE, echo = TRUE)

Arguments

...

zero or more objects which can be coerced to character (and which are pasted together with no separator) or (for message only) a single condition object.

exprObject

alternative to exprs or ...: an ‘expression-like’ object, typically an expression, but also a call, a name, or atomic constant such as TRUE.

local

(only when exprs is used:) indicates the environment in which the expressions should be evaluated; by default the one from where stopifnot() has been called.

.loggit

Should loggit() execute? Defaults to TRUE.

echo

Should loggit()'s log entry be echoed to the console, as well? Defaults to TRUE.

Value

(NULL if all statements in ... are TRUE.)

See Also

Other handlers: message(), stop(), warning()

Examples

  stopifnot("This is a completely false condition, which throws an error" = TRUE)


[Package loggit2 version 2.2.2 Index]