On Nov 2, 2010, at 2:14 AM, song song wrote:
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.
Try:
A[A$ID %in% B$ID, ]
Or:
subset(A, ID %in% B$ID)
How to do this in R>? Is there any commands to do this?
Thank you
[[alternative HTML version deleted]]
--
David Winsemius, MD
West Hartford, CT
______________________________________________
R-help@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.