title: Unlist nested list columns in data.table
body: <p>Unlist nested list column in data.table. Assuming all the list elements are the same type. The list elements are named, the name has to be handled also.<br>
  It is somehow opposite operation to <a href="https://stackoverflow.com/questions/23288509/data-table-aggregation-to-list-column">data.table aggregation to list column</a>.<br>
  I think it is worth to have it in SO <a href="/questions/tagged/data.table" class="post-tag" title="show questions tagged &#39;data.table&#39;" rel="tag">data.table</a> knowledge base.<br>
  My current workaround approach below, I'm looking for a little bit more canonical answer.</p>
  
  <p></p>
  
  <pre><code>library(data.table)
  dt &lt;- data.table(
      a = letters[1:3], 
      l = list(list(c1=6L, c2=4L), list(x=2L, y=4L, z=3L), list())
  )
  dt[]
  #    a      l
  # 1: a &lt;list&gt;
  # 2: b &lt;list&gt;
  # 3: c &lt;list&gt;
  dt[,.(a = rep(a,length(l)),
        nm = names(unlist(l)),
        ul = unlist(l)),
     .(id = seq_along(a))
     ][, id := NULL
       ][]
  #    a nm ul
  # 1: a c1  6
  # 2: a c2  4
  # 3: b  x  2
  # 4: b  y  4
  # 5: b  z  3
  # 6: c NA NA
  </code></pre>