data.table parlance, all
set* functions change their input by reference. That is, no copy is made at all, other than temporary working memory, which is as large as one column. The only other
data.table operator that modifies input by reference is
:=. Check out the
See Also section below for other
A helper function to convert a
list of equal length to
data.frame by reference.
data.table attributes including any keys of the input data.table are stripped off.
data.table is modified by reference to a
data.frame and returned (invisibly). If you require a copy, take a copy first (using
DT2 = copy(DT)). See
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)