I'd like to sample without replacement from MU, MG, PU, PG 70 times to create a matrix (ncol=4, nrow=70) e.g.
sample(c("MU","MG","PU","PG"), 4,F)
sample(c("MU","MG","PU","PG"), 4,F)
sample(c("MU","MG","PU","PG"), 4,F)
sample(c("MU","MG","PU","PG"), 4,F)
sample(c("MU","MG","PU","PG"), 4,F)
#etc
So far I have: matrix(sample(c("MU","MG","PU","PG"), 70*4,F), nrow = 70, byrow = TRUE) which isn't right because the rows may have more than just on instance each of MU, MG, PU, PG. Can I do this with a for loop or something more simple?