LSD-test produces error for this code;

code <- as.factor(Rotationdata_R$`Rot/code`)  #factor in the main
Nitrogen <- as.factor(Rotationdata_R$Nitrogen) #factor in the sub
Rep <- as.factor(Rotationdata_R$REP) #blocks
Year <- as.factor(Rotationdata_R$YEAR)  #years

model <- 
aov(Rotationdata_R$`GY(Mg/ha)`~Rep+code*as.factor(Nitrogen)+Error(Rep/Year/code),data=Rotationdata_R)
summary(model)

LSD.test(y=model,trt="code",console=TRUE)

the error;

Error in as.data.frame.default(x[[i]], optional = TRUE,
stringsAsFactors = stringsAsFactors) :
  cannot coerce class "c("aovlist", "listof")" to a data.frame

What is wrong with this.



Ahmed Attia, Ph.D.
Agronomist & Soil Scientist

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to