Take a look at the blockrand package, it may do what you want. > library(blockrand) #after installing > myrand <- blockrand(40, block.sizes=4) > myrand
hope this helps, ________________________________________ From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] On Behalf Of Ayesha Khan [ayesha.diamond...@gmail.com] Sent: Thursday, January 28, 2010 5:12 PM To: r-help@r-project.org Subject: [R] random permuted block randomization Hi, I am very new to R. Just started yesterday. I have to generate a sequence of 40 random treatments using permuted block randomization with a block size of 8. Then I have to plot moving averages for the resulting sequence. I have tried the sample function but I dont know if wht i did is right or not > sample(c(1,1,1,1,2,2,2,2),8) Any ideas please? -- Ayesha Khan MS Bioinformatics Dept. of Bioengineering Rice University, TX [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.