title: Separate a csv file based on common and uncommon dates from two separate csv files
body: <p>I have two csv files:</p>
  <p>DAT1:</p>
  <pre><code> Year,Month,Day,Rainfall
    1979,01,01,0.1
    1979,01,02,0.3
    1979,01,03,0.5
    1979,01,04,1
    1979,01,05,2
  </code></pre>
  <p>DAT2:</p>
  <pre><code> SN,CY,Year,Month,Day,Hour,MSLP
   1,1979,1979,01,03,06,1000
   3,1979,1979,01,05,12,999
  </code></pre>
  <p>I want to</p>
  <p>(1) extract the data with dates that are not common between DAT1 and DAT2.</p>
  <p>(2) extract the data with common dates between DATA1 and DAT2 and add the &quot;Rainfall&quot; column.</p>
  <p>So the expected output for (1) is:</p>
  <pre><code>Year,Month,Day,Rainfall
    1979,01,01,0.1
    1979,01,02,0.3
    1979,01,04,1
  </code></pre>
  <p>The expected output for (2) is:</p>
  <pre><code> SN,CY,Year,Month,Day,Hour,MSLP,Rainfall
   1,1979,1979,01,03,06,1000,0.5
   3,1979,1979,01,05,12,999,2
  </code></pre>
  <p>The DAT1 has continuous dates from 1979-01-01 (daily), while DAT2 has random dates.</p>
  <p>Right now, I am separating them manually! But I will be applying this for a data from 1979-2017.</p>
  <p>Is there a more efficient on how to do this in R?</p>
  <p>I'll appreciate any help on this.</p>