[R] Error message glmer using R: “ 'what' must be a character string or a function”

William Dunlap wdunlap at tibco.com
Wed Nov 6 17:04:07 CET 2013


You can reproduce the problem by having a data.frame (or anything else) in your
environment:

new <- data.frame(ï..VAR00001 = rep(c(TRUE,NA,FALSE), c(10,2,8)), random=rep(1:3,len=20), clustno=rep(c(1:5),len=20), validatedRS6=rep(0:1,len=20))
model1<- glmer(validatedRS6 ~ random + (1|clustno), data=new, family=binomial(), nAGQ=3)
# Error in do.call(new, c(list(Class = "glmResp", family = family), ll[setdiff(names(ll),  : 
#  'what' must be a character string or a function

The problem is in the call
   do.call(new, list())
It finds your dataset 'new' (in .GlobalEnv), which is not a function or the name of a function,
not the function 'new' from the 'methods' package.  Rename your dataset, so you do not
have anything called 'new' masking the one in package:methods, and things should work.

Write to the maintainer of the package (use maintainer("lme4") for the address) about the
problem.

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com


> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf
> Of EmmaB
> Sent: Tuesday, November 05, 2013 4:48 PM
> To: r-help at r-project.org
> Subject: Re: [R] Error message glmer using R: “ 'what' must be a character string or a
> function”
> 
> > str(new)
> 'data.frame':   1214 obs. of  4 variables:
>  $ ï..VAR00001 : logi  NA NA NA NA NA NA ...
>  $ random      : int  1 1 1 1 1 1 1 1 1 1 ...
>  $ clustno     : int  1 1 1 1 1 1 1 1 1 1 ...
>  $ validatedRS6: int  0 0 0 0 0 0 0 0 0 0 ...
> 
> 
> 
> --
> View this message in context: http://r.789695.n4.nabble.com/Error-message-glmer-
> using-R-what-must-be-a-character-string-or-a-function-tp4679829p4679836.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.


More information about the R-help mailing list