title: Cannot use dput for data.table in R
body: <p>I have following data.table for which I cannot use output of dput command to recreate it:</p>
  
  <pre><code>&gt; ddt
     Unit Anything index new
  1:    A      3.4     1   1
  2:    A      6.9     2   1
  3:   A1      1.1     1   2
  4:   A1      2.2     2   2
  5:    B      2.0     1   3
  6:    B      3.0     2   3
  &gt; 
  &gt; 
  &gt; str(ddt)
  Classes ‘data.table’ and 'data.frame':  6 obs. of  4 variables:
   $ Unit    : Factor w/ 3 levels "A","A1","B": 1 1 2 2 3 3
   $ Anything: num  3.4 6.9 1.1 2.2 2 3
   $ index   : num  1 2 1 2 1 2
   $ new     : int  1 1 2 2 3 3
   - attr(*, ".internal.selfref")=&lt;externalptr&gt; 
   - attr(*, "sorted")= chr  "Unit" "Anything"
  &gt; 
  &gt; 
  &gt; dput(ddt)
  structure(list(Unit = structure(c(1L, 1L, 2L, 2L, 3L, 3L), .Label = c("A", 
  "A1", "B"), class = "factor"), Anything = c(3.4, 6.9, 1.1, 2.2, 
  2, 3), index = c(1, 2, 1, 2, 1, 2), new = c(1L, 1L, 2L, 2L, 3L, 
  3L)), .Names = c("Unit", "Anything", "index", "new"), row.names = c(NA, 
  -6L), class = c("data.table", "data.frame"), .internal.selfref = &lt;pointer: 0x8948f68&gt;, sorted = c("Unit", 
  "Anything"))
  &gt; 
  </code></pre>
  
  <p>On pasting I get following error:</p>
  
  <pre><code>&gt; dt = structure(list(Unit = structure(c(1L, 1L, 2L, 2L, 3L, 3L), .Label = c("A", 
  + "A1", "B"), class = "factor"), Anything = c(3.4, 6.9, 1.1, 2.2, 
  + 2, 3), index = c(1, 2, 1, 2, 1, 2), new = c(1L, 1L, 2L, 2L, 3L, 
  + 3L)), .Names = c("Unit", "Anything", "index", "new"), row.names = c(NA, 
  + -6L), class = c("data.table", "data.frame"), .internal.selfref = &lt;pointer: 0x8948f68&gt;, sorted = c("Unit", 
  Error: unexpected '&lt;' in:
  "3L)), .Names = c("Unit", "Anything", "index", "new"), row.names = c(NA, 
  -6L), class = c("data.table", "data.frame"), .internal.selfref = &lt;"
  &gt; "Anything"))
  Error: unexpected ')' in ""Anything")"
  </code></pre>
  
  <p>Where is the problem and how can it be corrected? Thanks for your help.</p>