title: R dplyr - replace NA with 0 if
body: <p>I have this dataframe</p>
  <pre><code>dtf &lt;- data.frame(
      id = seq(1, 4),
      amt = c(1, 4, NA, 123),
      xamt = c(1, 4, NA, 123),
      camt = c(1, 4, NA, 123),
      date = c(&quot;2020-01-01&quot;, NA, &quot;2020-01-01&quot;, NA),
      pamt = c(1, 4, NA, 123)
  )
  </code></pre>
  <p>I'd like to replace all NA values in case that colname is numeric, in my case amt, xamt, pamt and camt. I'm looking for dplyr way. Normally I would use</p>
  <pre><code>replace(is.na(.), 0)
  </code></pre>
  <p>But this not works because of date column.</p>