title: Adding a new column where each element is a cumulative list of elements of another column
body: <pre><code>df &lt;- data.frame(category=c("cat1","cat1","cat2","cat1","cat2","cat2","cat1","cat2"),
                   value=c(1,2,3,4,5,6,7,8))
  </code></pre>
  
  <p>I want to add a new column to the above dataframe which lists the elements of <code>value</code> up to that point, grouped by <code>category</code>. In my head it would look something like:</p>
  
  <pre><code>df &lt;- df %&gt;%
    group_by(category) %&gt;%
    mutate(value_list=list(some_sort_of_cumulative_identity_function(value)))
  </code></pre>
  
  <p>so the desired output would be</p>
  
  <pre><code>  category value value_list
  1     cat1     1  1
  2     cat1     2  c(1,2)
  3     cat2     3  3
  4     cat1     4  c(1,2,4)
  5     cat2     5  c(3,5)
  6     cat2     6  c(3,5,6)
  7     cat1     7  c(1,2,4,7)
  8     cat2     8  c(3,5,6,8)
  </code></pre>
  
  <p>where the elements of value_list are lists.</p>