View source: R/catch_warnings.R
catch_warnings | R Documentation |
helper function
catch_warnings(expr)
expr |
an R expression to evaluate |
a list where the first entry is the result of expr
and the
second provides information about warnings
demo(error.catching)
log(3)
catch_warnings(log(3))
# produces warning
# log(-3)
# catch it
catch_warnings(log(-3))
# produces error
# log("x")
# catch it
catch_warnings(log("x"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.