title: Pivot on data.table similar to rehape melt function
body: <p>I have read some references to similar problems here on SO, but haven't been able to find a solution yet and wondering if there is any way to do the following using just data.table.</p>
  
  <p>I'll use a simplified example, but in practice, my data table has > 1000 columns similar to var1, var2, ... var1000, etc.</p>
  
  <pre><code>dt &lt;- data.table(uid=c("a","b"), var1=c(1,2), var2=c(100,200))
  </code></pre>
  
  <p>I am looking for a solution that will allow me to get an output similar to reshape's melt function --</p>
  
  <pre><code>&gt; melt(dt, id=c("uid"))
  uid variable value
  1   a     var1     1
  2   b     var1     2
  3   a     var2   100
  4   b     var2   200
  </code></pre>
  
  <p>That is, all the columns except for uid are listed under a single column with the corresponding values in an adjoining column. I have tried this with a combination of list, etc, but might be missing something that is obvious.</p>
  
  <p>All uids in dt are unique.</p>
  
  <p>Thanks in advance.</p>