title: Division by 0 in r, avoid NaN
body: <p>I have this code here:</p>
  
  <pre><code>d$ICER &lt;- d$Delta_Cost/d$Delta_LY
  </code></pre>
  
  <p>I do this for each row, in a matrix in R, now, the first row has values of <code>Delta_Cost</code> and <code>Delta_LY</code> = <code>0</code>, so <code>ICER</code> is <code>0/0</code> and gives me a value <code>NaN</code>.</p>
  
  <p>How can I modify it to be 0 instead of <code>NaN</code>?</p>