| with_msg_sink | R Documentation |
Sets sink for the duration of code, restoring the previous sink on exit
(including on error). Useful in tests and for short-lived capture.
with_msg_sink(sink, code)
sink |
Sink function or |
code |
Code to run. |
The value returned by code.
EDG
set_msg_sink(), get_msg_sink().
captured <- list()
with_msg_sink(
function(m) captured[[length(captured) + 1L]] <<- m,
{
# any msg() / msg0() / msgstart() / msgdone() calls in here are captured
}
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.