title: Treat NA as zero only when adding a number
body: <p>When calculating the sum of two data tables, <code>NA+n=NA</code>.</p>
  
  <pre><code>&gt; dt1 &lt;- data.table(Name=c("Joe","Ann"), "1"=c(0,NA), "2"=c(3,NA))
  &gt; dt1
     Name  1  2
  1:  Joe  0  3
  2:  Ann NA NA
  &gt; dt2 &lt;- data.table(Name=c("Joe","Ann"), "1"=c(0,NA), "2"=c(2,3))
  &gt; dt2
     Name  1 2
  1:  Joe  0 2
  2:  Ann NA 3
  &gt; dtsum  &lt;- rbind(dt1, dt2)[, lapply(.SD, sum), by=Name]
  &gt; dtsum
     Name  1  2
  1:  Joe  0  5
  2:  Ann NA NA
  </code></pre>
  
  <p>I don't want to substitute all NA's with 0. What I want is <code>NA+NA=NA</code> and <code>NA+n=n</code> to get the following result:</p>
  
  <pre><code>   Name  1  2
  1:  Joe  0  5
  2:  Ann NA  3
  </code></pre>
  
  <p>How is this done in R?</p>
  
  <p><strong>UPDATE: removed typo in dt1</strong></p>