Re: [R] merging 3 data sets at once

From: Gabor Grothendieck <ggrothendieck_at_gmail.com>
Date: Wed, 04 Jun 2008 20:50:47 -0400

Using the built in dataset, women, here is a 3-way merge on height using sqldf:

library(sqldf)
sqldf("select * from women u, women v, women w where u.height = v.height and v.height = w.height")

See home page at http://sqldf.googlecode.com for more info.

Its also possible in zoo if you can represent your data as zoo objects:

library(zoo)
w <- zoo(women$weight, women$height)
z <- merge(w, w, w) # zoo object
transform(as.data.frame(z), height = time(z)) # data frame

?zoo
?merge.zoo
Also three vignettes in package.

On Wed, Jun 4, 2008 at 7:24 PM, kayj <kjaja27_at_yahoo.com> wrote:
>
> Hi All,
>
> I am looking into merging 3 data sets I know how to do that by merging data1
> with data2 and then merging the result with data 3. I was wondering if it
> can be done all at once so I tried,
>
> M<-merge(data1,data2,data3, by="ID")
>
> It does not work!
> Any ideas?
>
>
>
> --
> View this message in context: http://www.nabble.com/merging-3-data-sets-at-once-tp17658873p17658873.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> 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.
>



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. Received on Thu 05 Jun 2008 - 00:56:50 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 05 Jun 2008 - 01:30:38 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive