This question is similar to the previous one.
I provide data from this example to ask a question.
id=c(1,2,3,4,5,6,7,8,9,10) var1=c(0,1,2,0,6,9,0,0,3,0) var2=c(0,0,2,3,0,0,0,5,0,0) var3=c(0,1,4,3,6,9,0,5,3,0) data=data.frame(id,var1,var2, var3)
I need: if the values โโare var1==var2 , then do var3==NA , but if they do not store the value of var3 . Would be happy to do this with the ifelse function in R, but other options are welcome.
Hope the question is clear enough.
Regards, Bazon