Error "'what' must be a character string or a function" using lme4::glmer in R -
this question has answer here:
i got following error message using example lme4::glmer:
>require(lme4) > (gm1 <- glmer(cbind(incidence, size - incidence) ~ period + (1 | herd), + data = cbpp, family = binomial)) error in do.call(new, c(list(class = "glmresp", family = family), ll[setdiff(names(ll), : 'what' must character string or function i hunted around , can't figure out what's wrong. have idea?
(posted answer clarity.)
i can't reproduce far: i've tried replicate loaded-package environment far can.
pkgs <- c("lme4","matrix","psych","plyr","car", "rms","sparsem","hmisc","formula","survival", "pscl","vcd","gam","coda","lattice", "mvtnorm","mass","gdata","mice","rcpp", "ggplot2","vimcom","setwidth") sapply(pkgs,library,character.only=true) sessioninfo() ## attached base packages: ## [1] splines grid stats graphics grdevices utils datasets ## [8] methods base ## ## other attached packages: ## [1] setwidth_1.0-3 vimcom_0.9-93 ggplot2_0.9.3.1 mice_2.21 ## [5] rcpp_0.11.0 gdata_2.13.2 pscl_1.04.4 vcd_1.3-1 ## [9] gam_1.09.1 coda_0.16-1 mvtnorm_0.9-9997 mass_7.3-30 ## [13] rms_4.1-3 sparsem_1.03 hmisc_3.14-3 formula_1.1-1 ## [17] survival_2.37-7 car_2.0-19 plyr_1.8.1 psych_1.4.2.3 ## [21] lme4_1.0-6 matrix_1.1-2-2 lattice_0.20-27 ## ## loaded via namespace (and not attached): ## [1] cluster_1.14.4 colorspace_1.2-4 dichromat_2.0-0 ## [4] digest_0.6.4 gtable_0.1.2 gtools_3.3.1 ## [7] labeling_0.2 latticeextra_0.6-26 minqa_1.2.3 ## [10] munsell_0.4.2 nlme_3.1-113 nnet_7.3-7 ## [13] proto_0.3-10 randomforest_4.6-7 rcolorbrewer_1.0-5 ## [16] reshape2_1.2.2 rpart_4.1-6 scales_0.2.3 ## [19] stringr_0.6.2 tools_3.1.0 gm1 <- glmer(cbind(incidence, size - incidence) ~ period + (1 | herd), data = cbpp, family = binomial) (works.) can make break if define variable called new:
new <- 123 gm1 <- glmer(cbind(incidence, size - incidence) ~ period + (1 | herd), data = cbpp, family = binomial) ## error in do.call(new, c(list(class = "glmresp", family = family), ll[setdiff(names(ll), : ## 'what' must character string or function (i thought bug fixed in v. 1.0-6, guess fixed subsequently ...)
if define function called new breaks differently. if remove new works again (as described).
can please try (1) rm("new") , (2) starting clean session?
unless else (preferably me) can reproduce error, it's going hard fix ...
Comments
Post a Comment