attempt | R Documentation |
A wrapper around base try that allows you to set a custom message when an error/warning occurs.
attempt
returns the value if there are no errors or messages.
attempt(expr, msg = NULL, verbose = FALSE, silent = FALSE)
expr |
the expression to be evaluated |
msg |
the message to return if an error or warning occurs |
verbose |
whether to return the expression producing the error |
silent |
whether the error should be silent |
## Not run:
attempt(log("a"), msg = "Nop !")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.