title: How to iterate through repeated dataset to get monthly totals?
body: <p>How would I iterate through a data frame in R to get total quantity for each variable based on dates (of arbitrary order and quantity)?</p>
  
  <pre><code>Date          Var
  2019-03-1    A    
  2019-01-1    A
  2019-03-1    B
  2019-02-1    A
  2019-01-1    A
  2019-01-1    B
  2019-02-1    A
  2019-02-1    A
  2019-02-1    B
  2019-01-1    A
  2019-03-1    C
  </code></pre>
  
  <p>To populate another frame that contains</p>
  
  <pre><code>Date         Var A          Var B            Var C
  2019-01-1    3              1                0
  2019-02-1    3              1                0
  2019-03-1    1              1                1
  </code></pre>