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.
r1<- 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<-function(x,n){matrix(rep(r1,each=100),nrow=100)}
rp <- rep.row(r1)
May you help me? Thanks you,