title: changing 2 state factor to 3 state factor 2
body: <p>Currently, I have my data arranged as a 2-factor data frame but I would like to convert the data to a 3-factor data frame as shown below,</p>
  <pre><code>ID       STATE AGE  W_NO
  90500974 1     17   1
  90500974 2     17   2
  90500974 1     17   3
  90500974 1     17   4
  90500974 2     17   5
  90500975 1     17   1
  90500975 2     17   2
  90500975 2     17   3
  90500975 1     17   4
  90500975 2     17   5
  
  *ID       STATE AGE  W_NO
  90500974 1     17   1
  90500974 2     17   2
  90500974 3     17   3
  90500974 3     17   4
  90500974 2     17   5
  90500975 1     17   1
  90500975 2     17   2
  90500975 2     17   3
  90500975 3     17   4
  90500975 2     17   5*
  </code></pre>
  <p>i.e., all the 1's that appear after a 2 should be converted to 3 for each subject. How can this be done in Rstudio?</p>