selector {hutils} | R Documentation |
Fast selection of data.table
columns
Description
Present since hutils 1.2.0
.
Usage
selector(DT, ..., cols = NULL, preserve.key = TRUE, shallow = FALSE)
Arguments
DT |
A |
... |
Unquoted columns names. |
cols |
Character vector of column names. |
preserve.key |
(logical, default: |
shallow |
(logical, default: |
Value
DT
with the selected columns.
Examples
RQ("nycflights13", no = {
library(nycflights13)
library(data.table)
fs <- as.data.table(flights)
fs1 <- selector(fs, year, month, day, arr_delay)
fs1[, arr_delay := NA]
})
[Package hutils version 1.8.1 Index]