Description Usage Arguments Examples
Deletes all of the columns in a data.table by reference except for the columns that you specify to keep.
1 | keepColsDT(data = NULL, keepCols = NULL, verbose = TRUE)
|
data |
a data.table |
keepCols |
a character vector of column names NOT to delete |
verbose |
TRUE by default, if FALSE it turns off the messages that appear after each column is deleted by reference. |
1 2 3 | columnsToKeep <- c("mpg", "cyl", "disp")
mtcars <- data.table(mtcars)
keepColsDT(mtcars, columnsToKeep)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.