Skip to content

Writing to a file

3 messages · Liaw, Andy, Brian Ripley, Melanie Vida

#
Would the following do?

x <- 1000
write.table(Info[Info[,4] > x, c(1, 4)], file="/tmp/CT.dat")

Andy
#
On Mon, 7 Mar 2005, Liaw, Andy wrote:

            
There is almost no penalty in writing a line at a time *if* you open a 
connection and write to that.  It might save you if Andy's solution runs 
you out of memory.  I would investigate doing this is large blocks of rows 
in that case.

  
    
#
Yes, Andy, the command you gave takes only a minute to output the whole 
data set to a file rather than mine, which takes hours to complete the 
file ouput operation. Thanks!
Liaw, Andy wrote: