I have following data.table for which I cannot use output of dput command to recreate it:
> ddt
Unit Anything index new
1: A 3.4 1 1
2:
The problem is that dput prints out external pointer address (this is something that data.table uses internally, and will reconstruct when required), which you can't really use.
If you manually cut out the .internal.selfref part, it will work just fine, except for a one-time complaint from data.table for some operations.
You could add an FR to data.table about this, but it will require modifying the base function from data.table, similar to how rbind is currently handled.