title: r repeat sequence number sequence while keeping the order of the sequence
body: <p>I want repeat a sequence for specific length:</p>
  
  <p>Sequence is 1:4 and I want to repeat the sequence till number of rows in a data frame. </p>
  
  <p>Lets say length of the data frame is <code>24</code></p>
  
  <p>I tried following: </p>
  
  <pre><code>test &lt;- rep(1:4, each=24/4)
  1 1 1 1 1 1 2 2 2 2 2 2 3 3 3 3 3 3 4 4 4 4 4 4
  </code></pre>
  
  <p>Lengthwise this is fine but i want to retain the sequence 
  <code>1 2 3 4 1 2 3 4 1 2 3 4.....</code></p>