catchWarning | R Documentation |
This is mainly used for code that either (a) generates a bunch of warnings, which makes it hard to find a warning that may have happened 78 warnings ago, or (b) generates a warning and an error, but it's hard to get at the warning because the error causes the code to crash before the warning is signalled.
catchWarning(expr)
expr |
An R expression |
out <- catchWarning(log('a'))
out$value
out <- catchWarning(as.numeric(c('1', 'a')))
out
out <- catchWarning(1+1)
out
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.