### set up two-way ANOVA with interactions
amod <- aov(waste ~ envir + temp + envir*temp, data=waste)
### set up linear hypotheses for all-pairs of both factors
wht <- glht(amod, linfct = mcp(temp = "Tukey", envir = "Tukey"))
### cf. Westfall et al. (1999, page 181)
summary(wht, test = adjusted("Shaffer"))
Run the code above in your browser using DataCamp Workspace