Carlos Ortega
2002-Jan-15 09:06 UTC
[R] Lower performance execution in read.table() in R-1.4.0 vs. R-1.3.1.. ?
Dear R-Help, I have been trying to read a file (66000 x 12 - ~ 10 Mb) in R-1.4.0 (W2000) getting error messages associated with the memory usage. I got a similar problem running on a Linux box (Mandrake 8.1 - PII 350 MHz, 160 Mb RAM). Luckily, I still had available the previous version R-1.3.1 in my Windows box, and when trying to read the same file, I do not get any particular problem, and even the response times are comparable to what I get on S-Plus2000 in the same machine. Please, do you know anything about the existence of this difference in performance/execution ? Is there any way to handle with R-1.4.0 ? Thanks in advance, Carlos Ortega. P.S: Attached are the error messages I got when reading the table as well as the specifics generated by R.Version() on my Windows machine. ++++++Error Message ++++++++++++> x<-read.table("C:\\Cof\\Datos\\posresult.txt",as.is=T,dec=",")Error: cannot allocate vector of size 62 Kb In addition: Warning message: Reached total allocation of 256Mb: see help(memory.size) ++++++R.Version()+++++++++++++++> R.Version()$platform [1] "i386-pc-mingw32" $arch [1] "x86" $os [1] "Win32" $system [1] "x86, Win32" $status [1] "" $major [1] "1" $minor [1] "4.0" $year [1] "2001" $month [1] "12" $day [1] "19" $language [1] "R" ++++++++++++++++++++++++++++++++ -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Prof Brian Ripley
2002-Jan-15 09:48 UTC
[R] Lower performance execution in read.table() in R-1.4.0 vs. R-1.3.1.. ?
On Tue, 15 Jan 2002, Carlos Ortega wrote:> Dear R-Help, > > I have been trying to read a file (66000 x 12 - ~ 10 Mb) in R-1.4.0 (W2000) > getting error messages associated with the memory usage. > I got a similar problem running on a Linux box (Mandrake 8.1 - PII 350 MHz, > 160 Mb RAM). > > Luckily, I still had available the previous version R-1.3.1 in my Windows > box, and when trying to read the same file, I do not get any particular > problem, and even the response times are comparable to what I get on > S-Plus2000 in the same machine. > > Please, do you know anything about the existence of this difference in > performance/execution ? Is there any way to handle with R-1.4.0 ?Yes, see the NEWS for R-patched. Adding the line to read.table while (nlines < 5) { line <- readLines(file, 1, ok = TRUE) if (length(line) == 0) break if (blank.lines.skip && length(grep("^[ \\t]*$", line))) next if (length(comment.char) && nchar(comment.char)) { pattern <- paste("^[ \\t]*", substring(comment.char, 1, 1), sep = "") if (length(grep(pattern, line))) next } lines <- c(lines, line) nlines <- nlines + 1 # add this line } will help a lot, but the fix in R-patched is better. If you are interested in performance, set colClasses. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._