[R] random permuted block randomization

Greg Snow Greg.Snow at imail.org
Fri Jan 29 03:32:25 CET 2010


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-bounces at r-project.org [r-help-bounces at r-project.org] On Behalf Of Ayesha Khan [ayesha.diamondash at gmail.com]
Sent: Thursday, January 28, 2010 5:12 PM
To: r-help at 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 at 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.


More information about the R-help mailing list