title: How to use tryCatch in R
body: <p>I would like to use <code>try()</code> or <code>tryCatch()</code> or a function like this to detect if there is an error in my model called "fit1". If the model is fine, I want to use "fit1", otherwise I want to use "fit2"</p>
  
  <pre><code>fit1&lt;-glmer(stat ~ dataint + DBH + DBH2 + (1|site_plot), family=binomial(link="logit"))
  
  fit2&lt;-glm (stat ~ dataint + DBH + DBH2, family=binomial(link="logit"))
  </code></pre>
  
  <p>Do you know how to do this?
  I don't add any data because my problem is probably easy to solve, but if it's needed, I can upload them.</p>
  
  <p>THanks!</p>