Displaying 2 results from an estimated 2 matches for "captureoutput".
2004 Oct 28
3
Table question
I have a table (output from table(factor1,factor2)). I would like to
use write.table to output that table to a file. However, it seems that
as.data.frame converts such a table to three columns, Var1, Var2, and
Freq rather than converting to the data.frame with equivalent numbers
of rows and columns. I can use write.matrix from the MASS package, but
then I get no rownames. Any hints here?
2015 Jan 02
3
Benchmark code, but avoid printing
Dear all,
I am trying to benchmark code that occasionally prints on the screen
and I want to
suppress the printing. Is there an idiom for this?
If I do
sink(tempfile)
microbenchmark(...)
sink()
then I'll be also measuring the costs of writing to tempfile. I could
also sink to /dev/null, which is probably fast, but that is not
portable.
Is there a better solution? Is writing to a