catch {gnn} | R Documentation |
Catching Results, Warnings and Errors Simultaneously
Description
Catches results, warnings and errors.
Usage
catch(expr)
Arguments
expr |
expression to be evaluated, typically a function call. |
Details
This function is particularly useful for large(r) simulation studies to not fail until finished.
Value
list
with components:
value |
value of |
warning |
warning message (see |
error |
error message (see |
Author(s)
Marius Hofert (based on doCallWE()
and tryCatch.W.E()
in
the R package simsalapar).
Examples
library(gnn) # for being standalone
catch(log(2))
catch(log(-1))
catch(log("a"))
[Package gnn version 0.0-4 Index]