title: Recoding data frame column based on multiple columns
body: <p>How do I recode a column based on values from other columns? Say I have the below data frame and I want to recode <code>df$Col3</code> so that the value is 0 if <code>df$Col1 == x</code> and <code>df$Col2 == a</code>.</p>
  
  <pre><code>&gt; df &lt;- data.frame(a=c(rep("x",3),rep("y",3),rep("x",4)),letters[c(1:5,3,4:1)],1:10)
  &gt; names(df)&lt;-c("Col1","Col2","Col3")
  &gt; df
     Col1 Col2 Col3
  1     x    a    1
  2     x    b    2
  3     x    c    3
  4     y    d    4
  5     y    e    5
  6     y    c    6
  7     x    d    7
  8     x    c    8
  9     x    b    9
  10    x    a   10
  </code></pre>