[R] how to compare two datasets in R>?

Santosh Srinivas santosh.srinivas at gmail.com
Tue Nov 2 07:21:48 CET 2010

Take a look at ?merge for doing such join operations. (I believe that should
If you had provided a sample of your datasets using dput, I would have
checked that for you.

-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On
Behalf Of song song
Sent: 02 November 2010 11:44
To: r-help at r-project.org
Subject: [R] how to compare two datasets in R>?

hi, everybody, my question is:

suppose I have two data sets, set A is large and have variables like ID,
Gender, Income.  Set B is small and suppose only has ID.

Now I want to get a subset from data set A which contains ID from Set B.

How to do this in R>?  Is there any commands to do this?

Thank you

	[[alternative HTML version deleted]]

R-help at r-project.org mailing list
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