title: Cumulative count of unique values in R
body: <p>A simplified version of my data set would look like:</p>
  
  <pre><code>depth value
     1     a
     1     b
     2     a
     2     b
     2     b
     3     c
  </code></pre>
  
  <p>I would like to make a new data set where, for each value of "depth", I would have the cumulative number of unique values, starting from the top. e.g.</p>
  
  <pre><code>depth cumsum
   1      2
   2      2
   3      3
  </code></pre>
  
  <p>Any ideas as to how to do this? I am relatively new to R.</p>