title: Patterned Vector in base
body: <p>I'd like to produce a vector with the following repeating pattern: </p>
  
  <pre><code>1 1 2 1 2 3 1 2 3 4 ... 
  </code></pre>
  
  <p>that ranges from one to some arbitrary stopping point. </p>
  
  <p>I can hack it together using an <code>sapply</code> followed by an <code>unlist</code>, as in the following, but it sure feels like there should be a base call that is more direct than this. </p>
  
  <pre><code>repeating_function &lt;- function(stop_point) { 
      res_list &lt;- sapply(1:stop_point, FUN=function(x) {1:x}, simplify=TRUE)
      res      &lt;- unlist(res_list)
  
      return(res)
  } 
  </code></pre>
  
  <p>Which produces: </p>
  
  <pre><code>repeating_function(5)
  
  [1] 1 1 2 1 2 3 1 2 3 4 1 2 3 4 5
  </code></pre>