I am doing simulations with glmer function. For every simulation I extract estimates,...into a database, but I also want to have a variable that would indicate whether simulated data converged properly or not. (I get warnings,for ex. singular convergence, false convergence,...but the estimates are given anyway).
I try
assign("last.warning", NULL, envir = baseenv()) # clear the previous warning
mod1=glmer(y~x+(1+x|study), family="binomial", data=test1)
warningss1=ifelse(length(warnings())>0, "yes", "no"); warningss1
It will always return me no even it divergent`