setDF: Convert a data.table to data.frame by reference

Description Usage Arguments Details Value See Also Examples

Description

A helper function to convert a data.table to data.frame by reference. It does not handle lists or lists of data.tables.

Usage

1
setDF(x)

Arguments

x

A data.table.

Details

This feature request came up on the data.table mailing list: http://bit.ly/1xkokNQ. All data.table attributes including any keys of the input data.table are stripped off.

Value

The input data.table is modified by reference to a data.frame.

See Also

setkey, setattr, setnames, set, :=, setorder, copy

web statistics

Examples

1
2
3
4
set.seed(45L)
X = data.table(x = 1:5, y=6:10)
## convert 'X' to data.frame, without any copy.
setDF(X)

Example output



data.table documentation built on May 2, 2019, 4:57 p.m.