title: Simultaneously merge multiple data.frames in a list
body: <p>I have a list of many data.frames that I want to merge. The issue here is that each data.frame differs in terms of the number of rows and columns, but they all share the key variables (which I've called <code>"var1"</code> and <code>"var2"</code> in the code below). If the data.frames were identical in terms of columns, I could merely <code>rbind</code>, for which plyr's <a href="https://stackoverflow.com/questions/2851327/r-converting-a-list-of-data-frames-into-one-data-frame">rbind.fill</a> would do the job, but that's not the case with these data. </p>
  
  <p>Because the <code>merge</code> command only works on 2 data.frames, I turned to the Internet for ideas. I got this one from <a href="http://www.mail-archive.com/r-help@r-project.org/msg46572.html" rel="noreferrer">here</a>, which worked perfectly in R 2.7.2, which is what I had at the time:</p>
  
  <pre><code>merge.rec &lt;- function(.list, ...){
      if(length(.list)==1) return(.list[[1]])
      Recall(c(list(merge(.list[[1]], .list[[2]], ...)), .list[-(1:2)]), ...)
  }
  </code></pre>
  
  <p>And I would call the function like so:</p>
  
  <pre><code>df &lt;- merge.rec(my.list, by.x = c("var1", "var2"), 
                  by.y = c("var1", "var2"), all = T, suffixes=c("", ""))
  </code></pre>
  
  <p>But in any R version after 2.7.2, including 2.11 and 2.12, this code fails with the following error:</p>
  
  <pre><code>Error in match.names(clabs, names(xi)) : 
    names do not match previous names
  </code></pre>
  
  <p>(Incidently, I see other references to this error <a href="https://stackoverflow.com/questions/2504543/merge-multiple-data-frames-error-in-match-namesclabs-namesxi-names-do-n">elsewhere</a> with no resolution).</p>
  
  <p>Is there any way to solve this? </p>