title: Calculate cumulative sum between two dates with a data.table in R
body: <p>I have a <code>data.table</code> with the following shape:</p>
  
  <pre><code>date_from    date_until    value
  2015-01-01   2015-01-03    100    
  2015-01-02   2015-01-05     50
  2015-01-02   2015-01-04     10
  ...
  </code></pre>
  
  <p>What I want to do is: I want to calculate for every date in the year the cumulative sum. For the first row the value 100 would be relevant for every day from 2015-01-01 until 2015-01-03. I want to add all values which are relevant for a certain date. </p>
  
  <p>So, in the end there would be a <code>data.table</code> like this:</p>
  
  <pre><code>date        value
  2015-01-01  100
  2015-01-02  160
  2015-01-03  160
  2015-01-04   60
  2015-01-05   50
  </code></pre>
  
  <p>Is there any easy way with the <code>data.table</code> to do this?</p>