sink
. For
sinks of type message
, an error is raised if such a sink is already
active.with_output_sink(new, code, append = FALSE, split = FALSE)with_message_sink(new, code, append = FALSE)
[character(1)|connection]
A writable connection or a character string naming the file to write
to. Passing NULL
will throw an error.[any]
Code to execute in the temporary environmentTRUE
, output will be appended to
file
; otherwise, it will overwrite the contents of
file
.TRUE
, output will be sent to the new
sink and to the current output stream, like the Unix program tee
.[any]
The results of the evaluation of the code
argument.withr
for examples