Description Usage Arguments Author(s) Examples
This function integrates futile.logger with the error and warning system so problems can be caught both in the standard R warning system, while also being emitted via futile.logger.
1 |
expr |
The expression to evaluate in a try block |
error |
An error handler |
finally |
Pass-through to tryCatch finally |
silent |
Boolean - should errors be rethrown? The same as the silent option on 'try'. If a custom error handler is being used that takes control over this option. Note you should test the return value if you are dependent on it. |
details |
An extra string to print when there's a warning message |
Brian Lee Yung Rowe
1 2 3 4 5 6 7 8 9 10 11 | ## Not run:
ftry(log("a")) # Logs the warning (but the warning still bubbles)
x <- 'a'
y <- 2 # Some ID associated with x value
ftry(log("a"), details=sprintf("y = %s",y))
ftry(log(-1)) # Logs the error and rethrows it
## End(Not run)
ftry(log(-1),silent=TRUE) # logs the error and silently continues
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.