tryCatchWEM {admisc} | R Documentation |
Try functions to capture warnings, errors and messages.
Description
This function combines the base functions tryCatch
() and
withCallingHandlers
() for the specific purpose of capturing
not only errors and warnings but messages as well.
Usage
tryCatchWEM(expr, capture = FALSE)
Arguments
expr |
Expression to be evaluated. |
capture |
Logical, capture the visible output. |
Details
In some situations it might be important not only to test a function, but also to capture everything that is written in the R console, be it an error, a warning or simply a message.
For instance package QCA (version 3.4) has a Graphical User Interface that simulates an R console embedded into a web based shiny app.
It is not intended to replace function tryCatch
() in any
way, especially not evaluating an expression before returning or exiting, it simply
captures everything that is printed on the console (the visible output).
Value
A list, if anything would be printed on the screen, or an empty (NULL) object otherwise.
Author(s)
Adrian Dusa