I guessed you mean 2 treatment groups, N=18 and 3 blocks (so n=6 per block):
blocks <- 3 ngroups <- 2 groupsize <- 3 group <- NULL; block <- NULL; set.seed(911) for (i in 1:blocks){ foo <- sample(rep(c('A', 'B'), groupsize)) group <- c(group, foo) block <- c(block, rep(i, groupsize*ngroups)) } cbind(group, block, rep(1:(groupsize*ngroups), blocks)) Denis *_____________________________________________Denis *Haine +1-514-572-7174 2014-06-12 13:59 GMT-04:00 Sarah Goslee <sarah.gos...@gmail.com>: > Sorry, try this again. > > Does this help: > > > http://www2.warwick.ac.uk/fac/sci/moac/degrees/moac/ch923/lectures/moac_-_designing_experiments_in_r.pdf > > If not, we need some more specifics about what you've tried and where > you are running into problems. > > Sarah > > > On Thu, Jun 12, 2014 at 11:34 AM, Chatcher <cnyi...@vols.utk.edu> wrote: > > Good Morning, > > I would like help with code that creates a RBD experiment. That is I > have 18 > > treatments and I will need three blocks. I cannot seem to find an easy > way > > to do this in R. > > I think it is a relatively easy thing to do but i tried Agricolae and > seem > > to be getting so "lost" I cannot even get started. > > > > Thanks. > > > > > -- > Sarah Goslee > http://www.sarahgoslee.com > http://www.functionaldiversity.org > > ______________________________________________ > 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. > [[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.