select_which {hutils} | R Documentation |
Select columns satisfying a condition
Description
Select columns satisfying a condition
Usage
select_which(DT, Which, .and.dots = NULL, checkDT = TRUE, .and.grep = NULL)
Arguments
DT |
A |
Which |
A function that takes a vector and returns |
.and.dots |
Optional extra columns to include. May be a character vector of |
checkDT |
If |
.and.grep |
A character vector of regular expressions to match to the names
of |
Value
DT
with the selected variables.
Examples
library(data.table)
DT <- data.table(x = 1:5,
y = letters[1:5],
AB = c(NA, TRUE, FALSE))
select_which(DT, anyNA, .and.dots = "y")
[Package hutils version 1.8.1 Index]