# # Written by: # -- # John L. Weatherwax 2009-04-21 # # email: wax@alum.mit.edu # # Please send comments and especially bug reports to the # above email address. # #----- # Put the treatements into a matrix form (each row is a set of samples): treatments = 1:7 M = matrix( c( sample(treatments), sample(treatments), sample(treatments), sample(treatments) ), ncol=7, byrow=TRUE ) F = data.frame(M) print(F) # This puts the random draws as columns rather than rows print( sapply( 1:4, function(x) sample(1:7) ) )