[R] appending and merging data frames

Gerrit Eichner Gerrit.Eichner at math.uni-giessen.de
Thu Feb 7 16:57:13 CET 2013


Hello, John,

as a start take a look at

?merge

And to (maybe) get a bit overwhelmed at first sight use

RSiteSearch( "merge")


  Hth  --  Gerrit

On Thu, 7 Feb 2013, John Smith wrote:

> I know that the basic approach to append or merge data frames is using the rbind and merge commands.
> However, if I understand things correctly, for both commands one needs to do quite some additional programming to get e.g. behavior as with the Stata append and morge commands or to achieve some things which I think users need quite frequently.
>
> E.g. for appending, the data frame must have identical column names. In order to rename columns or in order to add columns with missing values if necessary, additional programming is needed.
> For merging, all matches get combined, so it is not easily possible to check for 1:1 or 1:n matches or limit the join to such kind of matches, is it?
> Those are just examples, there are a number of additional details that would be useful to be able to control for merging/appending (maybe at the expense of restricting the operation to just data frames).
>
> So my question is: are there any packages or existing utility functions which would provide append and merge functionality at a slightly higher (user-friendly) level?
>
> Although I am quite a noob, I would be prepared to give it a try and program these myself, but I have the feeling that this must be so common that maybe it would mean re-inventing the wheel?
>
> ____________________________________________________________
> GET FREE SMILEYS FOR YOUR IM & EMAIL - Learn more at http://www.inbox.com/smileys
> Works with AIM®, MSN® Messenger, Yahoo!® Messenger, ICQ®, Google Talkÿÿ and most webmails
>
> ______________________________________________
> 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.


More information about the R-help mailing list