keepColsDT: keepColsDT()

Description Usage Arguments Examples

Description

Deletes all of the columns in a data.table by reference except for the columns that you specify to keep.

Usage

1
keepColsDT(data = NULL, keepCols = NULL, verbose = TRUE)

Arguments

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.

Examples

1
2
3
columnsToKeep <- c("mpg", "cyl", "disp")
mtcars <- data.table(mtcars)
keepColsDT(mtcars, columnsToKeep)

jakesherman/jakemisc documentation built on May 18, 2019, 9:08 a.m.