title: Merge and paste duplicate columns in R
body: <p>Suppose I have two data frames with some common variable <code>x</code>:</p>
  
  <pre><code>df1 &lt;- data.frame( 
    x=c(1, 2, 3, 4), 
    y=c("a", "b", "c", "d") 
  )
  
  df2 &lt;- data.frame( 
    x=c(1, 1, 2, 2, 3, 4, 5), 
    z=c("A", "B", "C", "D", "E", "F", "G") 
  )
  </code></pre>
  
  <p>We can assume that each entry of the variable we're merging over, <code>x</code>, appears exactly once in <code>df1</code>; however, it may appear an arbitrary number of times in <code>df2</code>.</p>
  
  <p>I want to merge <code>df2</code> 'into' <code>df1</code>, while preserving <code>df1</code>. Is there a fast way of merging these two data frames such that the merged output would be of the form (for example):</p>
  
  <pre><code>df_merged &lt;- data.frame( 
    x=c(1, 2, 3, 4), 
    y=c("a", "b", "c", "d"), 
    z=c("A B", "C D", "E", "F")
  )
  </code></pre>
  
  <p>Essentially, I want <code>df_merged</code> to be a composition of the original <code>df1</code>, in addition to any variables in <code>df2</code> coerced to match the format of <code>df1</code>. The various incantations of <code>merge</code> will append new rows to the merged output, which I want to avoid. </p>
  
  <p>We can assume that each entry of the variable we're merging over, <code>x</code>, appears exactly once.</p>
  
  <p>Speed is also a priority since I'll be merging fairly large data frames.</p>