title: Reshape long structured data.table into a wide structure using data.table functionality?
body: <pre><code>&gt; library(data.table)
  &gt; A &lt;- data.table(x = c(1,1,2,2), y = c(1,2,1,2), v = c(0.1,0.2,0.3,0.4))
  &gt; A
     x y   v
  1: 1 1 0.1
  2: 1 2 0.2
  3: 2 1 0.3
  4: 2 2 0.4
  &gt; B &lt;- dcast(A, x~y)
  Using v as value column: use value.var to override.
  &gt; B
    x   1   2
  1 1 0.1 0.2
  2 2 0.3 0.4
  </code></pre>
  
  <p>Apparently I can reshape a data.table from long to wide using f.x. dcast of package reshape2. But data.table comes along with an overloaded bracket-operator offering parameters like 'by' and 'group', which make me wonder if it is possible to achieve it using this (to data.table specific functionality)? </p>
  
  <p>Just one random example from the manual:</p>
  
  <pre><code>DT[,lapply(.SD,sum),by=x]
  </code></pre>
  
  <p>That looks awesome - but I don't fully understand the usage yet.</p>
  
  <p>I neither found a way nor an example for this so maybe it is just not possible maybe it isn't even supposed to be - so, a definite "no, is not possible because ..." is then of course also a valid answer.</p>