Hi merge() takes only 2 data frames. What can you do to it to make take more than two data frames? or is there another function that does that? Thanks joseph ____________________________________________________________________________________ Looking for last minute shopping deals? [[alternative HTML version deleted]]
Try this: data1 <- data.frame(Id=LETTERS[1:5], Value=sample(5)) data2 <- data.frame(Id=data1$Value, Value=c(10,20,30,40,50)) data3 <- data.frame(Id=data2$Value, Value=rnorm(5)) merge(merge(data1, data2, by.x="Value", by.y="Id"), data3, by.x="Value.1", by.y="Id") On 12/02/2008, joseph <jdsandjd at yahoo.com> wrote:> Hi > merge() takes only 2 data frames. What can you do to it to make take more than two data frames? or is there another function that does that? > Thanks > joseph > > > > > ____________________________________________________________________________________ > Looking for last minute shopping deals? > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- Henrique Dallazuanna Curitiba-Paran?-Brasil 25? 25' 40" S 49? 16' 22" O
The zoo package has a multi-way merge that works with zoo series There is an example in this thread in which non-zoo data are converted to zoo and merged: https://stat.ethz.ch/pipermail/r-help/2008-January/151541.html library(zoo) ?merge.zoo Also zoo has 3 vignettes you could look at. On Feb 12, 2008 11:12 AM, joseph <jdsandjd at yahoo.com> wrote:> Hi > merge() takes only 2 data frames. What can you do to it to make take more than two data frames? or is there another function that does that? > Thanks > joseph > > > > > ____________________________________________________________________________________ > Looking for last minute shopping deals? > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >
I have created a merged data frame and in turn merged that with another dataframe. I could see how it could become a pain if you had lots of dataframes. I would try running a for loop...but have never done it. "joseph" <jdsandjd at yahoo.com> wrote in message news:761390.10382.qm at web36901.mail.mud.yahoo.com...> Hi > merge() takes only 2 data frames. What can you do to it to make take more > than two data frames? or is there another function that does that? > Thanks > joseph > > > > > > ____________________________________________________________________________________ > Looking for last minute shopping deals? > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >