title: Catching the convergence or not by glmer in R
body: <p>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).</p>
  
  <p>I try </p>
  
  <pre><code>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())&gt;0, "yes", "no"); warningss1
  </code></pre>
  
  <p>It will always return me no even it divergent`</p>