Description Usage Arguments Value References Examples
View source: R/miscellaneous.R
Evaluates an expression. Returns a list with the value of expression and the number of warnings thrown by an expression.
1 | countWarnings(expr)
|
expr |
the expression to evaluate |
list of length two. The first element of the list is names "ans" and it contains the results of the expression. The second element of the list is named "warnings" and contains the number of warning generated by the expression.
1 2 3 4 5 6 7 8 | countWarnings(log(-1))
foo <- function(){
warning("first warning!")
warning("second warning!")
warning("third warning!")
invisible()
}
countWarnings(foo())
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.