Skip to content
Back to formatted view

Raw Message

Message-ID: <422C8914.4040802@mitre.org>
Date: 2005-03-07T17:02:12Z
From: Melanie Vida
Subject: Writing to a file

Here is a simple question. Is there a quicker way to write to a file 
several rows of data at a time rather than one line at a time? How can 
the code below be optimized to write several rows at a time to a file 
rather than one line at a time. See my slow method of write.table below:

---------------------------
x<-1000
for( i in 1:385420)
    (
    if(Info[i,4] > x)
       write.table (cbind(Info[i,1], Info[i,4], file="/tmp/CT.dat", 
append=TRUE, row.names=FALSE, col.names=FALSE)

Thanks,

-Melanie