Skip to content
Prev 2414 / 20628 Next

catch non-convergence in lmer as variable

Hmm.  I don't know about type -- I generally use
if (inherits(fitmodel,"try-error"))

   do you have an extra space at the end of "try-error"
in your type variable?

   I was using

glmer2 <- function(...) {
  op <- options(warn=2)
  on.exit(options(op))
  x <- try(glmer(...),silent=TRUE)
  if (inherits(x,"try-error")) {
    stop(x,unclass(x))
  }
  x
}
Ursa Reja wrote: