ExpectNoWarning | R Documentation |
Checks to see if the printing of an object does not cause a warning to appear.
ExpectNoWarning(code, string)
code |
The code to evaluate for warnings. |
string |
The string of text to be searched for in the warnings |
Returns NULL. Throws an exception if the code is evaluated and the string appears in the warning.
throwsAWarning <- function()
{
warning("This is a warning")
}
ExpectNoWarning(throwsAWarning(), "different warning")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.