[R] Iterative data.frame

Ott Toomet siim at obs.ee
Tue Sep 24 16:05:17 CEST 2002


Hi,

how do you generate your data frames?  By reading from file or combining
variables by data.frame()?  In the last case you can use args like
tag=value.  

I would use a list instead of auto-generating names:
m <- vector("list", 6)
for(i in 1:6) 
  m[[i]] <- data.frame(...)

If you really have to construct an unique name, use assign().

For merging, I would use either rbind() or cbind(), depending whether you
have the same variables or observations.

Perhaps it helps.

Ott


On Tue, 24 Sep 2002, Nolwenn Le Meur wrote:

  |Hi,
  |I would like to create data.frame and increment their name to finally merge
  |them.
  |Does anybody has a solution ?
  |
  |Something like that ?
  |
  |n<-6
  |for (i in 1:n) {
  |      m[i]<-data.frame(name,value)
  |	m<-merge(m[i]:m[n])
  |}

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