title: Collapse data.table column values while grouping
body: <p>given a <code>data.table</code> object I would to collapse the values of some grouped columns into a single object and insert the resulting objects into a new colum.</p>
  
  <pre><code>dt &lt;- data.table(
              c('A|A', 'B|A', 'A|A', 'B|A', 'A|B'),
              c(0, 0, 1, 1, 0),
              c(22.7, 1.2, 0.3, 0.4, 0.0)
  )
  setnames(dt, names(dt), c('GROUPING', 'NAME', 'VALUE'))
  dt
  #    GROUPING NAME VALUE
  # 1:      A|A    0  22.7
  # 2:      B|A    0   1.2
  # 3:      A|A    1   0.3
  # 4:      B|A    1   0.4
  # 5:      A|B    0   0.0
  </code></pre>
  
  <p>I think that to do this is first necessary to specify the column for which you want to group, so I should start with something like <code>dt[, OBJECTS := &lt;expr&gt;, by = GROUPING]</code>.</p>
  
  <p>Unfortunately, I don't know the expression <code>&lt;expr&gt;</code> to use so that the result is as follows:</p>
  
  <pre><code>#    GROUPING   OBJECTS
  # 1:      A|A  &lt;vector&gt;
  # 2:      B|A  &lt;vector&gt;
  # 3:      A|B  &lt;vector&gt;
  </code></pre>
  
  <p>Each <code>&lt;vector&gt;</code> must contain the values ​​of the other columns. E.g the first <code>&lt;vector&gt;</code> have to be a named vector equivalent to:</p>
  
  <pre><code>eg &lt;- c(22.7, 0.3)
  names(eg) &lt;- c('0', '1')
  #    0    1 
  # 22.7  0.3
  </code></pre>