title: Return NA within "mutate" when an error occurs
body: <p>I have a tibble, and I would like to create a column 'corr' with mutate:</p>
  <pre><code> tibble_with_result &lt;- tibble %&gt;% 
        group_by(Year, Universe, Industry, Metric) %&gt;% 
        mutate(corr = cor.test(
                      Score1,
                      Score2,
                      method = &quot;spearman&quot;)$estimate)
  </code></pre>
  <p>however <code>cor.test</code> might return an error (for example: not enough observation) for some of the groups. I would like corr to be NA when an error occur. Are there any alternatives to <code>tryCatch</code> as shown <a href="https://stackoverflow.com/questions/43380908/trycatch-in-r-execute-in-case-of-error">in this question?</a></p>