I have a design matrix generated by
grp.ids <- as.factor(c(rep(1,8), rep(2,4), rep(3,2)))
x <- model.matrix(~grp.ids)
Now I hope to vertically concatenate the matrix x 100 times. If I only want to do it 2 times, then a call to rbind(x,x) will work. How to repeat the process 100 times? Or is there any other function available for directly generating such a big design matrix (based on this small matrix block)?
You could use
do.call(rbind, replicate(100, x, simplify=FALSE))