[R] R lmer debugging: Error in [[<-.data.frame(*tmp*, i, value = integer(0)) : replacement has 0 rows, data has 117

Ben Bolker bbolker at gmail.com
Tue Dec 3 15:18:18 CET 2013


Pascal Oettli <kridox <at> ymail.com> writes:

> 
> Hello,
> 
> I get a result if I change 'as.factor(males)' to 'males'.
> 
> Hope this helps,
> Pascal
> 
> On 3 December 2013 18:43, Cynthia Tedore <Cynthia.Tedore <at> biol.lu.se> 
> wrote:
> > I am able to use lmer on an older computer without this error, but the new
> > version (downloaded yesterday) gives me this error message:
> >
> > Error in [[<-.data.frame(*tmp*, i, value = integer(0)) : replacement has 0
> > rows, data has 117
> >
> > in response to this function:
> >
> > model1<-lmer(threatened~as.numeric(focal.chel)+
> as.numeric(opponent.chel)+(1|as.factor(males)),na.action=na.omit,data=spiders)

This was cross-posted to StackOverflow and has an answer there

http://stackoverflow.com/questions/19749313/
  lme4-upgrade-produces-error-message-even-after-grouping-variables-
   within-the-dat/20353535#20353535

(broken URL to make Gmane happy)

  These questions are probably more appropriate for
r-sig-mixed-models at r-project.org ...

  Ben Bolker



More information about the R-help mailing list