Merging in r without writing multiple merge statements
<p>I have 1 data set which is the base &amp; there are 7 other datasets for 7 different years &amp; for 3 different regions .These datasets include amount,region &amp; year which is common to the base data.</p>

<p>However, I need to merge the 7 data sets 1 by one to the base dataset.How do I achieve that?</p>

<p>Base dataset:</p>

<pre><code>company_region  raised_amount_usd   Year
 SF Bay Area    1000050 2011
 SF Bay Area    2520000 2011
 SF Bay Area    15000   2010
 Singapore  615000  2011
</code></pre>

<p>For Year 2007:</p>

<pre><code> raised_amount_usd  z   e   Year company_region 
1.00E+06    5   0          2007  Singapore
8.00E+06    6   1          2007  Singapore
</code></pre>

<p>50000    3   0              2007  Singapore
   35000    3   0              2007  Singapore</p>

<p>&amp; similarly I have data for the other years 2008-2012.I need columns z &amp; e in my base data set.Instead of writing 7 merge statements how can it be done through a function?</p>

<p>Would be great if someone can help out.Thanks in advance!!</p>