[R] Finding values in one column and

Steven Ranney steven.ranney at gmail.com
Tue Nov 27 23:17:58 CET 2012


All -

I have a data frame

data.a
ID	valueA	valueB
6	12	12
17	15	14
58	18	16
98	11	12
73	19	20
84	19	14
58	20	14
24	11	12
81	15	16
21	15	14
62	14	12
67	13	14
78	13	17
35	10	13
13	11	15
14	17	18
85	16	15
35	13	9
18	15	16

and a data frame

data.b
ID	valueA	valueB
6		
84		
21		
78		
14		

I'd like to have R find the data.b$ID in data.a$ID and insert the
corresponding data.a$valueA and data.a$valueB into the appropriate
columns in data.b.

How can I do this?

Thanks for you help.

SR
Steven H. Ranney



More information about the R-help mailing list