Re: [R] Comparing two variables for match and creating a new vector with results

2012-08-26 Thread David Winsemius
On Aug 25, 2012, at 7:12 PM, inti luna wrote: Hello, I need help comparing two variables and producing a third variable with the result.I have this data: id <-c(1,2,3,4,5,6,7,8,9,10) vi <-c(1,0,1,1,1,1,1,2,2,0) vi2 <-c(0,1,1,1,1,1,1,2,0,0) data<-cbind(id,vi,vi2) For the data in the examp

[R] Comparing two variables for match and creating a new vector with results

2012-08-25 Thread inti luna
Hello, I need help comparing two variables and producing a third variable with the result.I have this data: id <-c(1,2,3,4,5,6,7,8,9,10) vi <-c(1,0,1,1,1,1,1,2,2,0) vi2 <-c(0,1,1,1,1,1,1,2,0,0) data<-cbind(id,vi,vi2) For the data in the example, I need to generate: id <-c(1,2,3,4,5,6,7,8,9,10)