Description Usage Arguments Examples
checkWarning
checks if a warning is generated by
an expression, and optionally follows an expected regular
expression pattern.
1 | checkWarning(expr, expected = TRUE, msg = NULL)
|
expr |
an R expression |
expected |
expected value as regular expression pattern. If a logical, then it specifies if a warning is expected or not. For backward compatibility, a |
msg |
informative message to add to the error in case of failure |
1 2 3 4 5 | # check warnings
checkWarning({ warning('ah ah'); 3})
checkWarning({ warning('ah oh ah'); 3}, 'oh')
try( checkWarning(3) )
try( checkWarning({ warning('ah ah'); 3}, 'warn you') )
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.