Displaying 1 result from an estimated 1 matches for "captureviaraw".
2014 Feb 04
0
capture.output(): Using a rawConnection() [linear] instead of textConnection() [exponential]?
...<- 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()
captureViaRaw <- function(..., local=TRUE, envir=parent.frame()) {
eval({
# Basically what capture.output() does by default
file <- rawConnection(raw(0L), open="w")
capture.output(..., file=file)
res <- rawConnectionValue(file)
close(file)
res <- rawToChar(res)...