# Completely Randomised Design
des.out <- design(type = "crd", treatments = c(1, 5, 10, 20),
reps = 5, nrows = 4, ncols = 5, seed = 42)
# Randomised Complete Block Design
des.out <- design("rcbd", treatments = LETTERS[1:11], reps = 4,
nrows = 11, ncols = 4, brows = 11, bcols = 1, seed = 42)
# Latin Square Design
# Doesn't require reps argument
des.out <- design(type = "lsd", c("S1", "S2", "S3", "S4"),
nrows = 4, ncols = 4, seed = 42)
# Factorial Design (Crossed, Completely Randomised)
des.out <- design(type = "crossed:crd", treatments = c(3, 2),
reps = 3, nrows = 6, ncols = 3, seed = 42)
# Factorial Design (Crossed, Completely Randomised), renaming factors
des.out <- design(type = "crossed:crd", treatments = c(3, 2),
reps = 3, nrows = 6, ncols = 3, seed = 42,
fac.names = list(N = c(50, 100, 150),
Water = c("Irrigated", "Rain-fed")))
# Factorial Design (Crossed, Randomised Complete Block Design),
# changing separation between factors
des.out <- design(type = "crossed:rcbd", treatments = c(3, 2),
reps = 3, nrows = 6, ncols = 3,
brows = 6, bcols = 1,
seed = 42, fac.sep = c(":", "_"))
# Factorial Design (Nested, Latin Square)
trt <- c("A1", "A2", "A3", "A4", "B1", "B2", "B3")
des.out <- design(type = "lsd", treatments = trt,
nrows = 7, ncols = 7, seed = 42)
# Split plot design
des.out <- design(type = "split", treatments = c("A", "B"), sub_treatments = 1:4,
reps = 4, nrows = 8, ncols = 4, brows = 4, bcols = 2, seed = 42)
# Alternative arrangement of the same design as above
des.out <- design(type = "split", treatments = c("A", "B"), sub_treatments = 1:4,
reps = 4, nrows = 8, ncols = 4, brows = 4, bcols = 2,
byrow = FALSE, seed = 42)
Run the code above in your browser using DataLab