[R] Lower performance execution in read.table() in R-1.4.0 vs. R-1.3.1.. ?
Prof Brian Ripley
ripley at stats.ox.ac.uk
Tue Jan 15 10:48:21 CET 2002
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list