title: R: changing value of a cell depending on two conditions
body: <p>I would like to increase the value of a cell in a dataframe by 1 if two cells in other columns meet certain conditions. How do I do that?</p>
  
  <p>This is how I do it for one condition:</p>
  
  <pre><code>`+`(data.frame[which(data.frame$col1 == some.value),]$col2 , 1)
  </code></pre>
  
  <p>I hoped that</p>
  
  <pre><code>`+`(data.frame[which(data.frame$col1 == some.value &amp;&amp; data.frame$col3 == some.other.value),]$col2 , 1)
  </code></pre>
  
  <p>would work, but it doesn't.</p>
  
  <p>Any ideas for an elegant solution?</p>