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
> On Dec 25, 2017, at 10:21 AM, Ahmed Attia <ahmedatia80 at gmail.com> wrote: > > LSD.test?LSD.test No documentation for ?LSD.test? in specified packages and libraries: you could try ???LSD.test? -- David Winsemius Alameda, CA, USA 'Any technology distinguishable from magic is insufficiently advanced.' -Gehm's Corollary to Clarke's Third Law
The model should be class aov or lm and my model class is aovlist. tried tidy from broom library but did not work. To make it class aov, I had to remove the error term; model <- aov(Rotationdata_R$`GY(Mg/ha)`~Rep+code*as.factor(Nitrogen),data=Rotationdata_R) Ahmed Attia, Ph.D. Agronomist & Soil Scientist On Mon, Dec 25, 2017 at 7:38 PM, David Winsemius <dwinsemius at comcast.net> wrote:> >> On Dec 25, 2017, at 10:21 AM, Ahmed Attia <ahmedatia80 at gmail.com> wrote: >> >> LSD.test > > ?LSD.test > No documentation for ?LSD.test? in specified packages and libraries: > you could try ???LSD.test? > > -- > David Winsemius > Alameda, CA, USA > > 'Any technology distinguishable from magic is insufficiently advanced.' -Gehm's Corollary to Clarke's Third Law > > > > >