title: Wrapper function around sum ignored by R data.table
body: <p>I wrote a wrapper function to set default behavior, but it only works if I rename it:</p>
  <pre><code>mysum &lt;- sum &lt;- function(...){
      if('na.rm' %in% names(list(...))){
          return(base::sum(...))
      } else{
          return(base::sum(..., na.rm = TRUE))
      }
  }
  </code></pre>
  <pre><code>trnData[
      , 
      .(CZK=sum(czkAmount)), 
      by = day %&gt;% weekdays()
  ]
  </code></pre>
  <p>still yields NAs.</p>
  <pre><code>trnData[
      , 
      .(CZK=mysum(czkAmount)), 
      by = day %&gt;% weekdays()
  ]
  </code></pre>
  <p>Works.</p>
  <p>What is going on?</p>