[R] Merging Data Sets with Full Outer Join

Ista Zahn istazahn at gmail.com
Wed Apr 20 21:46:37 CEST 2016


Kunden <- Kunden_2011
Kunden <- merge(Kunden, Kunden_2012,
                by = "Debitor", all = TRUE)

etc.

See ?merge for details.

Best,
Ista

On Wed, Apr 20, 2016 at 2:23 AM,  <G.Maubach at weinwolf.de> wrote:
> Hi All,
>
> I would like to match some datasets. Both deliver variables AND cases
> which might or might not be present in all datasets:
>
> This sequence
>
> Kunden <- Kunden_2011
> Kunden <- merge(Kunden, Kunden_2012,
>                 by.x = "Debitor", by.y = "Debitor")
>
> Kunden <- merge(Kunden, Kunden_2013,
>                 by.x = "Debitor", by.y = "Debitor")
>
> Kunden <- merge(Kunden, Kunden_2014,
>                 by.x = "Debitor", by.y = "Debitor")
>
> Kunden <- merge(Kunden, Kunden_2015,
>                 by.x = "Debitor", by.y = "Debitor")
>
> delivers too few cases. So I guess it does an equi-join.
>
> How can I join the datasets and keep the variables as well as the cases?
>
> I am looking forward to your reply.
>
> Kind regards
>
> Georg
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.



More information about the R-help mailing list