title: Setting column name in "group by" operation with data.table
body: <p>I am a new user of the <a href="http://cran.r-project.org/web/packages/data.table/index.html">data.table</a> package in R.
  I am trying to give a name to the new column created by a "group by" command</p>
  
  <pre><code>&gt; DT = data.table(x=rep(c("a","b"),c(2,3)),y=1:5) 
  &gt; DT
  x y
  1: a 1
  2: a 2
  3: b 3
  4: b 4
  5: b 5
  &gt; DT[,{z=sum(y);z+3},by=x]
  x V1
  1: a 6
  2: b 15
  </code></pre>
  
  <ol>
  <li>I would like to name the V1 (default) column directly (not having to use colnames), is it possible?</li>
  <li><p>Additionally, is it possible to perform several group by operations in one command, that would result in something like:</p>
  
  <pre><code>   x V1 V2
  1: a 6  something
  2: b 15 something
  </code></pre></li>
  </ol>
  
  <p>Thanks</p>