title: How to use tryCatch in R to set value to 0?
body: <p>I'm not very experienced with R and I'm trying to do some error handling.
  Heres my code:</p>
  <pre><code>tryCatch(Retest_rate &lt;- GetReTestRate(Data))
    error = function(e){
      Retest_rate &lt;- 0
      return(Retest_rate)
    }
  </code></pre>
  <p>I just want Retest_rate to be zero if an error occurs.
  Thanks.</p>