TukeyHSD.aov ends up with an error
Error in prjs[, "(Intercept)"] : subscript out of bounds
when the lm model has no intercept (for instance, if one sets the contrasts to FALSE).
The bug comes from the fact that TukeyHSD calls model.tables.aov(x, "means"), which calculates factor means from the intercept.
Steps to reproduce:
dd <- data.frame(F=factor(rep(c("A","B","C"),each=3)), num=1:9)
lin <- lm(num~0+F, data=dd, contrasts=list(F=contr.sum(3, contrasts=FALSE)))
anov <- aov(lin)
The obvious workaround is to run a specific model (with intercept) for aov, as the results of the Tukey test should not depend on the contrasts chosen.
In the original design there were no aov fits without intercepts.
model.tables and TukeyHSD have been modified to accommodate them from 3.2.2 patched.