[R] lme function cannot find object

Ben Bolker bbolker at gmail.com
Thu Jun 6 14:35:54 CEST 2013


Pfeiffer, Steven <pfeiffss <at> miamioh.edu> writes:


> I have been using the function lme() from package 'nlme' for several months
> now without any problems.  Suddenly, it cannot find a factor in my data.
> Is this a new bug of some kind?  My code and output are below.
> Thanks for your help!
> -Steve Pfeiffer

  You have an extra comma at the end of the first line of
your lme code (indicated with ^^^), so R thinks your interaction term is a
separate argument and tries to intepret it outside the context
of the formula ...

library("nlme")
fit.1<-lme(soil.moisture ~ Trenching + DaysSinceEvent,
                                                   ^^^^^
                                         + Trenching:DaysSinceEvent,
                 random = ~ DaysSinceEvent | Plot,
                 data=Dat.middle,
                 method="ML"
                )



More information about the R-help mailing list