title: Merge multiple data.frames in R with varying row length
body: <p>I'm relatively new to R and trying to figure out how to merge multiple data.frames with varying numbers of rows but all with a common column, "Year". I've looked through similar questions, and this question: 
  <a href="https://stackoverflow.com/questions/14102498/merge-dataframes-different-lengths">Merge dataframes, different lengths</a> 
  provided a great answer. However, when I applied it to my own data, I couldn't get it to work with multiple data.frames; I always receive an error message.</p>
  
  <p>Sample data:</p>
  
  <pre><code>&gt; df1 &lt;- data.frame(Year=2006:2011, Site1=c("2.3", "1"  , "3.1", "2.9", "1.4", "3"))  
  &gt; df2 &lt;- data.frame(Year=2007:2011, Site2=c("2.7", "4.1", "1.1", "2.6", "3.1"))  
  &gt; df3 &lt;- data.frame(Year=2008:2011, Site3=c("1.3", "2"  , "3.6", "1.7"))  
  </code></pre>
  
  <p>The goal is to produce a single data.frame where column 1 is the year, column 2 is site 1, column 3 is site 2, and so on. I have ~17 data.frames currently (there will be up to 40), corresponding to 17 sites with variable timelines/number of rows.</p>
  
  <p>Any help would be appreciated.</p>
  
  <p>Code I've tried:</p>
  
  <pre><code>&gt; NewDF &lt;- merge(df1, df2, by="Year", all.x=TRUE, all.y=TRUE)  
  </code></pre>
  
  <p>This worked great for 2 data.frames, but when I tried to add in another data.frame, I received the error message:  </p>
  
  <pre><code>&gt; NewDF &lt;- merge(list=c(df1, df2, df3), by="Year", all.x=TRUE, all.y=TRUE)  
   Error in as.data.frame(x) : argument "x" is missing, with no default
  </code></pre>