X = data.table(x=1:5, y=6:10)
## convert 'X' to data.frame, without any copy.
setDF(X)
X = data.table(x=1:5, y=6:10)
## idem, assigning row names
setDF(X, rownames = LETTERS[1:5])
X = list(x=1:5, y=6:10)
# X is converted to a data.frame without any copy.
setDF(X)
Run the code above in your browser using DataLab