# NOT RUN {
## Construct a randomized layout for the split-unit design described by
## Brien et al. (2011, Section 5)
split.sys <- cbind(fac.gen(list(Months = 4, Athletes = 3, Tests = 3)),
fac.gen(list(Intensities = LETTERS[1:3], Surfaces = 3),
times = 4))
split.lay <- designRandomize(allocated = split.sys[c("Intensities", "Surfaces")],
recipient = split.sys[c("Months", "Athletes", "Tests")],
nested.recipients = list(Athletes = "Months",
Tests = c("Months", "Athletes")),
seed = 2598)
## Plot the design
cell.colours <- c("lightblue","lightcoral","lightgoldenrod","lightgreen","lightgrey",
"lightpink","lightsalmon","lightcyan","lightyellow","lightseagreen")
split.lay <- within(split.lay,
Treatments <- fac.combine(list(Intensities, Surfaces),
combine.levels = TRUE))
plt <- designGGPlot(split.lay, labels = "Treatments",
row.factors = "Tests", column.factors = c("Months", "Athletes"),
colour.values = cell.colours[1:9], size = 6,
blockdefinition = rbind(c(3,1)), blocklinecolour = "darkgreen",
printPlot = FALSE)
#Add Month boundaries
designBlocksGGPlot(plt, nrows = 3, ncolumns = 3, blockdefinition = rbind(c(3,3)))
#### A layout for a growth cabinet experiment that allows for edge effects
data(Cabinet1.des)
plt <- designGGPlot(Cabinet1.des, labels = "Combinations", cellalpha = 0.75,
title = "Lines and Harvests allocation for Cabinet 1",
printPlot = FALSE)
## Plot Mainplot boundaries
plt <- designBlocksGGPlot(plt, blockdefinition = cbind(4,16), originrow= 1 ,
blocklinecolour = "green", nrows = 9, ncolumns = 16,
printPlot = FALSE)
plt <- designBlocksGGPlot(plt, blockdefinition = cbind(1,4),
blocklinecolour = "green", nrows = 1, ncolumns = 16,
printPlot = FALSE)
plt <- designBlocksGGPlot(plt, blockdefinition = cbind(1,4), originrow= 9,
blocklinecolour = "green", nrows = 10, ncolumns = 16,
printPlot = FALSE)
## Plot all 4 block boundaries
plt <- designBlocksGGPlot(plt, blockdefinition = cbind(8,5,5,4), blocksequence = TRUE,
origincolumn = 1, originrow= 1,
blocklinecolour = "blue", nrows = 9, ncolumns = 15,
printPlot = FALSE)
plt <- designBlocksGGPlot(plt, blockdefinition = cbind(10,16),
blocklinecolour = "blue", nrows = 10, ncolumns = 16,
printPlot = FALSE)
## Plot border and internal block boundaries only
plt <- designBlocksGGPlot(plt, blockdefinition = cbind(8,14), origincolumn = 1, originrow= 1,
blocklinecolour = "blue", nrows = 9, ncolumns = 15,
printPlot = FALSE)
plt <- designBlocksGGPlot(plt, blockdefinition = cbind(10,16),
blocklinecolour = "blue", nrows = 10, ncolumns = 16)
# }
Run the code above in your browser using DataLab