data <- data.frame(
rep = rep(1:3, each = 24),
irrigation = rep(rep(c("I1", "I2"), each = 12), 3),
variety = rep(rep(c("V1", "V2", "V3"), each = 4), 6),
nitrogen = rep(c("N0", "N1", "N2", "N3"), 18),
yield = rnorm(72, 1200, 150)
)
anova_spd_ab_main(data, response = "yield",
main_factor1 = "irrigation", main_factor2 = "variety",
sub_plot = "nitrogen", replication = "rep")
Run the code above in your browser using DataLab