Description Usage Arguments Value Examples
This function allows to coerce a data.table to a data.frame without making in-memory copy. Therefore, you do not need 3x your current memory to coerce to a data.frame from a data.table.
1 | setDF(x)
|
x |
Type: data.table. The data.table to convert to data.frame. |
Nothing (the data.table is transformed to a data.frame already)
1 2 3 4 5 6 7 8 9 10 | library(data.table)
df <- data.frame(matrix(nrow = 100, ncol = 10))
coln <- colnames(df)
rown <- rownames(df)
setDT(df)
is.data.table(df) # Returns TRUE = OK
sum(c(coln == colnames(df), c(rown == rownames(df)))) # Returns 2 = OK
setDF(df)
is.data.table(df) # Returns FALSE = OK
sum(c(coln == colnames(df), c(rown == rownames(df)))) # Returns 2 = OK
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.