afex icon indicating copy to clipboard operation
afex copied to clipboard

all_fit nmkbw does not work, when afex is not attached

Open singmann opened this issue 7 years ago • 0 comments

I intend to fix later.

library("lme4")
library("optimx")
gm1 <- glmer(cbind(incidence, size - incidence) ~ period + (1 | herd),
             data = cbpp, family = binomial)

gm_all <- afex::all_fit(gm1)
!sapply(gm_all,inherits,"error") 
#                       bobyqa.                  Nelder_Mead. 
#                          TRUE                          TRUE 
#                 optimx.nlminb               optimx.L-BFGS-B 
#                          TRUE                          TRUE 
# nloptwrap.NLOPT_LN_NELDERMEAD     nloptwrap.NLOPT_LN_BOBYQA 
#                          TRUE                          TRUE 
#                        nmkbw. 
#                         FALSE 

gm_all[["nmkbw."]]
## <simpleError in getOptfun(optimizer): couldn't find optimizer function nmkbw>

library("afex")
gm_all <- all_fit(gm1)
!sapply(gm_all,inherits,"error") 
#                       bobyqa.                  Nelder_Mead. 
#                          TRUE                          TRUE 
#                 optimx.nlminb               optimx.L-BFGS-B 
#                          TRUE                          TRUE 
# nloptwrap.NLOPT_LN_NELDERMEAD     nloptwrap.NLOPT_LN_BOBYQA 
#                          TRUE                          TRUE 
#                        nmkbw. 
#                          TRUE 

singmann avatar Sep 27 '18 08:09 singmann