View source: R/lavaSearch2-tryWithWarnings.R
tryWithWarnings | R Documentation |
Similar to try
but also returns warnings.
tryWithWarnings(expr)
expr |
the line of code to be evaluated |
from https://stackoverflow.com/questions/4948361/how-do-i-save-warnings-and-errors-as-output-from-a-function
a list containing:
value the result of the evaluation of the expression
warnings warning(s) generated during the evaluation of the expression
error error generated during the evaluation of the expression
Brice Ozenne
FctTest <- function(x){
return(log(x))
}
tryWithWarnings(FctTest(-1))
tryWithWarnings(FctTest(1))
tryWithWarnings(FctTest(xxxx))
' '
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.