powered by
Drop column or columns
drop_col(DT, var, checkDT = TRUE)drop_cols(DT, vars, checkDT = TRUE)
drop_cols(DT, vars, checkDT = TRUE)
A data.table.
data.table
Quoted column to drop.
Should the function check DT is a data.table?
DT
Character vector of columns to drop. Only the intersection is dropped; if any vars are not in names(DT), no warning is emitted.
vars
names(DT)
DT with specified columns removed.
# NOT RUN { if (requireNamespace("data.table", quietly = TRUE)) { library(data.table) DT <- data.table(x = 1, y = 2, z = 3) drop_col(DT, "x") } # }
Run the code above in your browser using DataLab