data <- expand.grid(
year = c("Y1", "Y2", "Y3"),
rep = 1:3,
irrigation = c("I1", "I2", "I3"),
variety = c("V1", "V2", "V3", "V4")
)
data$yield <- rnorm(nrow(data), 1200, 180)
anova_spd_pooled(data, response = "yield", main_plot = "irrigation",
sub_plot = "variety", environment = "year", replication = "rep")
Run the code above in your browser using DataLab