title: R: cumulative total at a daily level
body: <p>I have the following dataset:</p>
  
  <p><a href="https://i.stack.imgur.com/f6GuY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/f6GuY.png" alt="enter image description here"></a></p>
  
  <p>I want to measure the cumulative total at a daily level. So the result look something like:</p>
  
  <p><a href="https://i.stack.imgur.com/rdfUv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rdfUv.png" alt="enter image description here"></a></p>
  
  <p>I can use dplyr's cumsum function but the count for "missing days" won't show up. As an example, the date 1/3/18 does not exist in the original dataframe. I want this missed date to be in the resultant dataframe and its cumulative sum should be the same as the last known date i.e. 1/2/18 with the sum being 5. </p>
  
  <p>Any help is appreciated! I am new to the language.</p>