condition_handler | R Documentation |
Function is intented to wrap expressions provided and catching all potentially useful information generated by the wrapped expression, i.e. errors, warnings, and messages.
condition_handler(expr, file = NULL)
expr |
(expression) for which exception handling should be provided |
file |
(character) string specifying a file to which all captured output shall be written |
(list) with element "result", "status" (0 = no warnings, no errors), 1 = warnings were caught, 2 = errors were caught no result generated, "warnings", "errors", "messages"
Andre Schuetzenmeister andre.schuetzenmeister@roche.com
condition_handler(warning("This is a warning!"))
f <- function(expr){warning("This a warning!"); eval(expr)}
condition_handler(f(1/2))
condition_handler(stop("This is an error!"))
condition_handler(1/"a")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.