I would like to merge ?data1 ?that contains 100 unique ID?s with another data set ?data 2? with 150 ID?s and the age of those individuals ( the ID in data1 is a subset of the ID in data 2) I would like to merge these data1 with data2 and have the result of the merge to have the ID ordered as in data1. Can this be done in R? -- View this message in context: http://www.nabble.com/merge-two-data-sets-tp17636278p17636278.html Sent from the R help mailing list archive at Nabble.com.
Where do you want to place ID's which are in data2 but NOT in data1? --- On Wed, 4/6/08, kayj <kjaja27 at yahoo.com> wrote:> From: kayj <kjaja27 at yahoo.com> > Subject: [R] merge two data sets > To: r-help at r-project.org > Received: Wednesday, 4 June, 2008, 9:45 AM > I would like to merge ?data1 ?that contains 100 unique > ID?s with another > data set ?data 2? with 150 ID?s and the age of those > individuals ( the ID in > data1 is a subset of the ID in data 2) I would like to > merge these data1 > with data2 and have the result of the merge to have the ID > ordered as in > data1. > > Can this be done in R? > > > -- > View this message in context: > http://www.nabble.com/merge-two-data-sets-tp17636278p17636278.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.
Please see ?merge In particular, see all.x parameter. Mark 2008/6/4 kayj <kjaja27 at yahoo.com>:> > I would like to merge "data1 "that contains 100 unique ID's with another > data set "data 2" with 150 ID's and the age of those individuals ( the ID in > data1 is a subset of the ID in data 2) I would like to merge these data1 > with data2 and have the result of the merge to have the ID ordered as in > data1. > > Can this be done in R? > > > -- > View this message in context: http://www.nabble.com/merge-two-data-sets-tp17636278p17636278.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. > > ______________________________________________________________________ > This email has been scanned by the MessageLabs Email Security System. > For more information please visit http://www.messagelabs.com/email > ______________________________________________________________________ >-- Dr. Mark Wardle Specialist registrar, Neurology Cardiff, UK