[R] rbind() very slow

Peter Dalgaard BSA p.dalgaard at biostat.ku.dk
Wed Apr 17 16:33:30 CEST 2002


"Philippe Grosjean" <phgrosje at ulb.ac.be> writes:

> Hi,
> 
> I have 16 tables of 39 variables with around 1500 to 3500 cases in each
> table. These 16 tables are in 16 different data frames. I want to merge them
> in a single large data frame, so:
> 
> All <- rbind(T1, T2, ...)
> 
> The problem: it is VERY slow, and takes a lot of memory (> 500 Mb) on my
> Athlon XP1800+, 1.75 Go memory, Win 2000 Pro SP1, R 1.4.1. Any suggestion to
> improve speed, and/or memory use?
> Thanx,

No fix, but could you try running the profiler over this? I.e.

Rprof()
All <- rbind(T1, T2, ...)
Rprof(NULL)

and then on the command line

Rcmd Rprof Rprof.out

If this proves awkward on Windows, could you cook up an example (e.g.
with random data) that reproduces the effect?

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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