View source: R/dt_keeprownames.R
dt_keeprownames | R Documentation |
This a wrapper function around data.table(df, keep.rownames=TRUE)
For more information about data.table
and data.frame
Google it.
dt_keeprownames(df, check.names=FALSE, key = NULL, stringsAsFactors = FALSE)
df |
a |
check.names |
same as in data.frame |
key |
character vector of one or more column names which is passed to setkey |
stringsAsFactors |
same as in data.table |
returns a data.table
dt_keeprownames(mtcars) ## Not run: dt_keeprownames(data.table(mtcars)) # this will throw an error because input is not a data.frame df <- mtcars rownames(df) <- NULL dt_keeprownames(df) # if data.frame has no row names, the returned data.table will create column rn with row index numbers ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.