library(agricolae)
data(sweetpotato)
attach(sweetpotato)
model<-aov(yield~virus)
df<-df.residual(model)
MSerror<-deviance(model)/df
comparison<- LSD(yield,virus,df,MSerror,alpha=0.05,main="Yield of sweetpotato")
Run the code above in your browser using DataLab