title: Conditional merge/replacement in R
body: <p>I have two data frames:</p>
  
  <pre><code>df1
  x1  x2
  1   a
  2   b
  3   c
  4   d
  </code></pre>
  
  <p>and</p>
  
  <pre><code>df2
  x1  x2
  2   zz
  3   qq
  </code></pre>
  
  <p>I want to replace some of the values in df1$x2 with values in df2$x2 based on the conditional match between df1$x1 and df2$x2 to produce:</p>
  
  <pre><code>df1
  x1  x2
  1   a
  2   zz
  3   qq
  4   d
  </code></pre>