I'm running Windows XP, and I recently upgraded to R 3.1.1 and updated all the packages. Oddly, I can't run a lmer on my own data any more. My code worked when I was using R 2.15. I also tried using the sleepstudy dataset in the lme4 package, and things worked fine.
I'm looking at the change in seedling count in 16 plots (8 in the high diversity treatment, 8 in the low diversity treatment) across 6 dates. Here's the data frame's structure:
>str (Dataset)
'data.frame': 96 obs. of 5 variables:
Plot : Factor w/ 16 levels "10B","12A","13B",..: 12 13 14 15 16 1 2 3 4 5 ...
Trt : Factor w/ 2 levels "high","low": 2 1 1 2 1 2 1 2 2 1 ...
Date : Factor w/ 6 levels "Apr-12","Apr-13",..: 1 1 1 1 1 1 1 1 1 1 ...
Seed : int 0 0 2 7 1 0 8 0 2 5 ...
I tried to run the full model with Date and Treatment as the fixed factors and Plot as the random factor:
> seeds <- lmer(Seed~Trt*Date+(1|Plot), Dataset)
But I keep on getting this error:
Error in get(ctr, mode = "function", envir = parent.frame()) :
object 'contr.Treatment' of mode 'function' was not found
I've tried running a simplified model with just treatment and plot or just date and plot, and I still get the same error. Did I do something funky when importing the data into R? Any ideas what I'm doing wrong?
-- UPDATE 9/29/2014 --
So I've tried running aov on some fake data, and even that doesn't work. Here's my code:
> thing = c(4, 5, 4, 3, 2, 4, 3, 4, 4, 6, 8, 4, 5, 4, 6, 5, 8, 6, 6, 7, 6, 6, 7, 5, 6, 5, 5)
> treatment = c(rep("A",9), rep("B",9), rep("C",9))
> Dataset = data.frame(thing,treatment)
> results = aov(thing ~ treatment, data=Dataset)
And I get the same error:
Error in get(ctr, mode = "function", envir = parent.frame()) :
object 'contr.Treatment' of mode 'function' was not found