[R] scan question

John Logsdon j.logsdon at lancaster.ac.uk
Wed Mar 22 22:34:30 CET 2000


Hi

In R 0.90.1 is there a way of stopping scan() from rewinding to the
beginning of the file?  Basically I have a mega-file (250Mb!!!) that I
want to read and process in 301 line chunks, each line having 151 numbers
on it.

If I do
for (i in 1:many){
  pp<-scan('filename',skip=(i-1)*301,nlines=301)
}

it appears to do what I want but as the chunks get further down the file
it gets slower and slower.

So can I stop the rewind?

TIA

John

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list