failWith | R Documentation |
Inspired from one of Hadley's functions (in plyr or something?)
failWith(
default = NULL,
expr,
frame = parent.frame(),
message = geterrmessage(),
silent = FALSE,
file = stderr()
)
default |
the value to return if |
expr |
the expression to take a shot at |
frame |
the frame to evaluate the expression in |
message |
the error message to display if |
silent |
if |
file |
where msg sends the message |
the result of expr
if successful, otherwise default
value.
# look, this doesn't throw an error, it just returns NULL
x <- failWith(NULL, stop("no error, just NULL"), silent = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.