50% off | Unlimited Data & AI Learning
Get 50% off unlimited learning

popEpi (version 0.2.1)

setcolsnull: Delete data.table columns if there

Description

Delete data.table columns if there

Usage

setcolsnull(DT = NULL, delete = NULL, keep = NULL, colorder = FALSE,
  soft = TRUE)

Arguments

DT
a data.table
delete
a character vector of column names to be deleted
keep
a character vector of column names to keep; the rest will be removed; keep overrides delete
colorder
logical; if TRUE, also does setcolorder using keep
soft
logical; if TRUE, does not cause an error if any variable name in keep or delete is missing; soft = FALSE useful for programming sometimes