title: data.tables and sweep function
body: <p>Using a data.table, which would be the fastest way to "sweep" out a statistic across a selection of columns?</p>
  
  <p>Starting with (considerably larger versions of ) DT</p>
  
  <pre><code>p &lt;- 3
  DT &lt;- data.table(id=c("A","B","C"),x1=c(10,20,30),x2=c(20,30,10))
  DT.totals &lt;- DT[, list(id,total = x1+x2) ]
  </code></pre>
  
  <p>I'd like to get to the following data.table result by indexing the target columns (2:p) in order to skip the key:</p>
  
  <pre><code>    id  x1  x2
  [1,]    A   0.33    0.67
  [2,]    B   0.40    0.60
  [3,]    C   0.75    0.25
  </code></pre>