Re: [R] scan() vs readChar() speed

2012-04-01 Thread baptiste auguie
Thanks; I did not notice an appreciable difference between scan() and scan(what=double()) in this example. Adding to my confusion, I noted a strange and apparently systematic discrepency between the timing results when the code is run within R.app, within emacs, or from a terminal. Any idea what mi

Re: [R] scan() vs readChar() speed

2012-04-01 Thread Duncan Murdoch
On 12-04-01 2:58 AM, baptiste auguie wrote: Dear list, I am trying to find a fast solution to read moderately large (1 -- 10 million entries) text files containing only tab-delimited numeric values. My test file is the following, nr<- 1000 nc<- 5000 m<- matrix(round(rnorm(nr*nc),3),nr=nr) writ

[R] scan() vs readChar() speed

2012-04-01 Thread baptiste auguie
Dear list, I am trying to find a fast solution to read moderately large (1 -- 10 million entries) text files containing only tab-delimited numeric values. My test file is the following, nr <- 1000 nc <- 5000 m <- matrix(round(rnorm(nr*nc),3),nr=nr) write.table(m, file = "a.txt", append=FALSE,