captureOutput

0th

Percentile

Evaluate an R expression and captures the output

Evaluate an R expression and captures the output.

Keywords
programming, IO
Usage
captureOutput(expr, file=NULL, append=FALSE, collapse=NULL, envir=parent.frame())
Arguments
expr
The R expression to be evaluated.
file
A file name or a connection to where the output is directed. Alternatively, if NULL the output is captured to and returned as
append
If TRUE, the output is appended to the file or the (unopened) connection, otherwise it overwrites.
collapse
If TRUE, then argument expr is not parsed (via substitute()), otherwise it is.
envir
The environment in which the expression js evaluated.
Details

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 [1].

Value

References

[1] R-devel thread 'capture.output(): Using a rawConnection() [linear] instead of textConnection() [exponential]?', 2014-02-03. https://stat.ethz.ch/pipermail/r-devel/2014-February/068349.html

See Also

Internally, eval() is used to evaluate the expression. and capture.output to capture the output.

Aliases
  • captureOutput
Documentation reproduced from package R.utils, version 1.32.4, License: LGPL (>= 2.1)

Community examples

Looks like there are no examples yet.