title: aggregate by past dates (12 months) in R
body: <p>I am trying to summarise/aggregate data by date. For simplicity, I only need to do it for row 4 in the following data example. For example, the date in row 4 is "2014-06-06" (June 2014), so I want to sum Price and Vat (by Group_ID) for all dates in the last 12 months i.e. between 2013-06-01 and 2014-05-31 (i.e., sum of row 1,2,3,6).   </p>
  
  <pre><code> Date       Price    Vat    Group_ID
   2014-01-10   705000  5023.00   A      
   2014-05-11   580000  6786.00   A       
   2014-05-19   333000  1809.84   A    
   2014-06-06   213000  1875.00   A (need result for this row only)     
   2014-06-21   310000  1905.96   B    
   2013-06-30   280000  3227.00   A
   2014-06-22   280000  3227.00   B
   2014-06-16   280000  3227.00   B
   2014-06-15   280000  3227.00   B
   2013-05-18   280000  3227.00   A    
  </code></pre>
  
  <p>The expected result for row 4 would be:</p>
  
  <pre><code>Date         S_Price   S_Vat      Group_ID
  2014-06-06   1898000  16845.84     A  
  </code></pre>