title: How to create a consecutive group number
body: <p>I have a data frame (<code>all_data</code>) in which I have a list of sites (1... to n) and their scores e.g.</p>
  
  <pre><code>  site  score
       1    10
       1    11  
       1    12
       4    10 
       4    11
       4    11
       8    9
       8    8
       8    7
  </code></pre>
  
  <p>I want create a column that numbers each level of site in numerical order, like a counter. In the example, the sites (1, 4, and 8) would be have a corresponding counter from 1 to 3 in the 'number' column:</p>
  
  <pre><code>site  score number
       1    10    1
       1    11    1 
       1    12    1 
       4    10    2
       4    11    2
       4    11    2
       8    9     3
       8    8     3 
       8    7     3
  </code></pre>
  
  <p>I am sure this must be easily solved, but I have not found a way yet.</p>