Re: [R] relating data in two data frames

2012-08-20 Thread arun
Hi, Try this: A<-data.frame(FID=c("a","a","b","b","c","c","d","d","d","d")) B<-read.table(text=" FID Age a  5 b  7 c  9 d  3 ",sep="",header=TRUE) library(plyr) join(A,B,type="inner") Joining by: FID    FID Age 1    a   5 2    a   5 3    b   7 4    b   7 5    c   9 6    c   9 7   

Re: [R] relating data in two data frames

2012-08-19 Thread David Winsemius
On Aug 19, 2012, at 5:56 PM, Sapana Lohani wrote: Hi, My data.frame "A" has FID like this FID a a b b b c c d d d d Now my second data.frame "B" has age value for a, b, c, d like FID Age a 5 b 7 c 9 d 3 How can search for the Age column in "B" and replace the value