drop_colr: Drop columns whose names match a pattern

View source: R/drop_colr.R

drop_colrR Documentation

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

library(data.table)
dt <- data.table(x1 = 1, x2 = 2, y = 3)
drop_grep(dt, "x")



hutils documentation built on April 13, 2022, 5:23 p.m.