Displaying 1 result from an estimated 1 matches for "captureviatext".
2014 Feb 04
0
capture.output(): Using a rawConnection() [linear] instead of textConnection() [exponential]?
...only writing an ASCII "a" character multiple times.
Q. Is it possible to utilize rawConnection() instead of
textConnection() and still get the same output regardless of
encodings?
Q. What causes textConnection() to be exponential when rawConnection()
is linear?
REPRODUCIBLE EXAMPLE:
captureViaText <- function(..., local=TRUE, envir=parent.frame()) {
eval({
# Basically what capture.output() does by default
file <- textConnection("rval", open="w", local=local)
capture.output(..., file=file)
close(file)
rval
}, envir=envir)
} # captureViaText()...