Skip to content
Prev 49575 / 63424 Next

Benchmark code, but avoid printing

On Fri, Jan 2, 2015 at 9:02 AM, G?bor Cs?rdi <csardi.gabor at gmail.com> wrote:
Interesting problem.  On Windows NUL corresponds to /dev/NULL, e.g.
con <- file("NUL", open="wb").  Not that it's cross platform, but it
at least allows you to cover on more OS.  Maybe R should have a
built-in "null" device.  An easier solution is probably to go back to
the maintainers of the functions outputting text and ask them for an
option to disable that.
For large number of output *lines* (not characters), textConnection()
is exponentially slow (at least in R 3.1.0).  Use rawConnection()
instead, cf. http://www.jottr.org/2014/05/captureOutput.html

/Henrik