title: R Keep random function in a vector repeating function
body: <p>I need to repeat 100 times a vector of 16 numbers with some fixed numbers and some randomly created in specific spots. I created a function, but it repeats the first vector randomly generated, even the random numbers. But I need that the function sample work in every repeated vector, to obtain an array of 100 random numbers in the positions desired.</p>
  
  <pre><code>r1&lt;- c(1,3,2,1,2,sample(1:4,1,replace=T),4,sample(1:4,1,replace=T),3,sample(1:4,1,replace=T),
   sample(1:4,1,replace=T),2,sample(1:4,1,replace=T),1,sample(1:4,1,replace=T),3)
  
  rep.row&lt;-function(x,n){matrix(rep(r1,each=100),nrow=100)}       
  rp &lt;- rep.row(r1)
  </code></pre>
  
  <p>May you help me? Thanks you,</p>