Could you please turn this into a minimal REPRoducible EXample (reprex) for your issue?
This is what I get if I try to run your code as a reprex
dat <- data.frame(stringsAsFactors=FALSE,
year = c(2017, 2017, 2017, 2017, 2017, 2017, 2017, 2017, 2017, 2017,
2017),
Plot = c(11, 12, 13, 14, 15, 21, 22, 23, 24, 25, 31),
SeedingDate = c("Sep", "Sep", "Sep", "Sep", "Sep", "Sep", "Sep", "Sep",
"Sep", "Sep", "Sep"),
Rep = c(1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3),
Treat = c("Controlled", "Deep Fraze", "Verticut", "Less Fraze",
"Scalped", "Less Fraze", "Deep Fraze", "Verticut",
"Scalped", "Controlled", "Scalped"),
CalDays = c(161, 35, 161, 84, 63, 63, 49, 84, 84, 84, 35)
)
library(nlme)
block<-as.factor(dat$Rep)
trt<-as.factor(dat$Treat)
seeddate<-as.factor(dat$SeedingDate)
yr<-as.factor(dat$year)
str(dat)
#> 'data.frame': 11 obs. of 6 variables:
#> $ year : num 2017 2017 2017 2017 2017 ...
#> $ Plot : num 11 12 13 14 15 21 22 23 24 25 ...
#> $ SeedingDate: chr "Sep" "Sep" "Sep" "Sep" ...
#> $ Rep : num 1 1 1 1 1 2 2 2 2 2 ...
#> $ Treat : chr "Controlled" "Deep Fraze" "Verticut" "Less Fraze" ...
#> $ CalDays : num 161 35 161 84 63 63 49 84 84 84 ...
DIA0WAS<-lme(CalDays ~ Treat*SeedingDate, random = ~1|year/Rep, data=dat)
#> Error in `contrasts<-`(`*tmp*`, value = contr.funs[1 + isOF[nn]]): contrasts can be applied only to factors with 2 or more levels
anova(DIA0WAS)
#> Error in anova(DIA0WAS): objeto 'DIA0WAS' no encontrado
predictmeans(DIA0WAS,"Treat:SeedingDate",pairwise=TRUE)
#> Error in predictmeans(DIA0WAS, "Treat:SeedingDate", pairwise = TRUE): no se pudo encontrar la función "predictmeans"
Created on 2019-06-21 by the reprex package (v0.3.0)