data <- data.frame(
rep = rep(1:3, each = 24),
irrigation = rep(rep(c("I1", "I2", "I3"), each = 8), 3),
variety = rep(rep(c("V1", "V2"), each = 4), 9),
nitrogen = rep(c("N1", "N2", "N3", "N4"), 18),
yield = rnorm(72, 1200, 150)
)
anova_spd_c_main_ab_sub(data, response = "yield",
main_plot = "irrigation",
sub_factor1 = "variety", sub_factor2 = "nitrogen",
replication = "rep")
Run the code above in your browser using DataLab