[R] questions on data management

From: zhijie zhang <epistat_at_gmail.com>
Date: Thu 06 Jul 2006 - 11:49:46 EST


Dear friends,
 suppose i have two datasets: A and B
A:
id<-1:6
x<-c(1,2,3,4,5,6)
y<-c(2,4,6,8,3,2)
xy<-data.frame(id,x,y)
B
 m<-c(1,1,3,3,5,5)
n<-c(2,2,6,6,3,3)
mn<-data.frame(m,n)
Now, i want to perfomr two tasks:
1. get a subset of B,no duplicate values,: C:
m n
1 2

3 6
5 3

2.Extract the values in A on the conditions that x=m and y=n the results should be:
 id x y
1 1 2
3 3 6
5 5 3
Thanks very much!

-- 
Kind Regards,
Zhi Jie,Zhang ,PHD
Department of Epidemiology
School of Public Health
Fudan University
Tel:86-21-54237149

	[[alternative HTML version deleted]]

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Thu Jul 06 11:52:37 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 06 Jul 2006 - 22:15:13 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.