title: group and label rows in data frame by numeric in R
body: <p>I need to group and label every x observations(rows) in a dataset in R.<br>
  I need to know if the last group of rows in the dataset has less than x observations</p>
  
  <p>For example:
  If I use a dataset with 10 observations and 2 variables and I want to group by every 3 rows.
  I want to add a new column so that the dataset looks like this:</p>
  
  <pre><code>    speed     dist       newcol
          4        2            1
          4       10            1
          7        4            1
          7       22            2
          8       16            2
          9       10            2
         10       18            3
         10       26            3
         10       34            3
         11       17            4
  </code></pre>