title: Special type of dummy code in r
body: <p>I'm looking to do a special type of dummy coding procedure in R. Basically, I want a function that looks at each level of an ordinal variable and codes them sequentially. Here's what I need: </p>
  
  <pre><code>Variable_1 --&gt; Variable_1a  Variable_1b  Variable_1c
  1               1            0            0
  1               1            0            0
  2               1            1            0
  2               1            1            0
  3               1            1            1
  3               1            1            1
  </code></pre>
  
  <p>I can do this manually using ifelse statements but there has to be an easier way. </p>