Evaluate an R expression and captures the output
Evaluate an R expression and captures the output.
captureOutput(expr, file=NULL, append=FALSE, collapse=NULL, envir=parent.frame())
- The R expression to be evaluated.
- A file name or a
connectionto where the output is directed. Alternatively, if
NULLthe output is captured to and returned as
TRUE, the output is appended to the file or the (unopened) connection, otherwise it overwrites.
TRUE, then argument
expris not parsed (via
substitute()), otherwise it is.
environmentin which the expression js evaluated.
This methods immitates
capture.output with the major
difference that it captures strings via a
raw connection rather
than via internal strings. The latter becomes exponentially slow
for large outputs .
 R-devel thread 'capture.output(): Using a rawConnection() [linear]
instead of textConnection() [exponential]?', 2014-02-03.