library(agricolae)
data(sweetpotato)
attach(sweetpotato)
model<-aov(yield~virus)
df<-df.residual(model)
MSerror<-deviance(model)/df
comparison <- HSD.test(yield,virus,df,MSerror, group=TRUE,
main="Yield of sweetpotato. Dealt with different virus")
Run the code above in your browser using DataLab