hutils (version 1.5.0)

drop_colr: Drop columns whose names match a pattern

Description

drop_colr present since hutils 1.0.0.

drop_grep is identical but only present since hutils 1.2.0.

Usage

drop_colr(DT, pattern, ..., checkDT = TRUE)

Arguments

DT

A data.table.

pattern

A regular expression as in grepl.

...

Arguments passed to grepl.

checkDT

If TRUE (the default), will error if DT is not a data.table.

Examples

Run this code
# NOT RUN {
library(data.table)
dt <- data.table(x1 = 1, x2 = 2, y = 3)
drop_grep(dt, "x")


# }

Run the code above in your browser using DataCamp Workspace