dt_keep_cols: Keep columns in a data.table

View source: R/utilities.R

dt_keep_colsR Documentation

Keep columns in a data.table

Description

Takes a data.table and a quoted sequence of column names and removes all columns but the ones specified

Usage

dt_keep_cols(DT, ...)

Arguments

DT

A data.table

...

arbitrary number of column names in quotes

Value

Returns data.table with only those columns

Examples

mt <- as.data.table(mtcars)
dt_keep_cols(mt, "mpg", "am", "gear", "carb")


libbib documentation built on Nov. 10, 2022, 6:16 p.m.