title: Create a sequence based on factor level's length in R
body: <p>I am using R right now and I am trying to create a new column "c" with a sequence dependent on the length of column "a" factor level. I have the example the before and after example. I am having trouble creating the "after" table. Can anyone help?</p>
  
  <pre><code>BEFORE
      a b
      1 hi
      1 hello
      1 howdy
      1 hola
      2 world
      2 world
      3 something
      3 someone
  
  AFTER    
      a b          c
      1 hi         1
      1 hello      2
      1 howdy      3
      1 hola       4
      2 world      1
      2 world      2
      3 something  1 
      3 someone    2 
  </code></pre>