[R] list to matrix

Peter Dalgaard BSA p.dalgaard at biostat.ku.dk
Thu Feb 10 12:31:51 CET 2000


cstrato at EUnet.at writes:

> I have a list with 7000 matrices, every matrix has 2 columns but
> different row-sizes.
> Now I want to combine all lists into one matrix with 2 columns. I would
> have to write:
> 
> ma <- rbind(list[[1]],list[[2]], and so on) (this works fine for lists
> with few matrices)
> 
> Since it is not possible to write:
>           ma <- rbind(list[[1:7000]]) or
>           ma <- rbind(list[[1]]:list[[7000]])
> maybe someone could tell me how to do it?

do.call("rbind", list)

-- 
   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