title: Using seq() and rep() function in R
body: <p>I need to do the following in R:
  I have a number (N), for example <code>N &lt;- 7</code>
  and I have a length (size), for example <code>size &lt;- 3</code></p>
  
  <p>And for example if N==7 and size==3, I need to get an output a vector same as:</p>
  
  <pre><code>v &lt;- c(1,1,1,1,1,1,2,2,2,2,2,2,2,3,3,3,3,3,3,3)
  </code></pre>
  
  <p>you see in v, each number from 1 to size is repeated N times. Is there any way to do this in R  without using a for loop?</p>