title: if values of two columns are equal, change the value of resultant column to NA and if not keep to original value of resultant column - using R
body: <p>This question is similar to the previous one.</p>
  
  <p>I am providing this example data to get my question across.</p>
  
  <pre><code>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) 
  </code></pre>
  
  <p>What I need is:
  if values of <code>var1==var2</code>, then make <code>var3==NA</code> but if they are not then keep the value of <code>var3</code>. 
  Would be glad to get it done using the <code>ifelse</code> function in R but other options are welcomed.</p>
  
  <p>I hope that the question is clear enough.</p>
  
  <p>Regards,
  Bazon</p>