Select columns satisfying a condition
select_which(DT, Which, .and.dots = NULL, checkDT = TRUE)
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 |
DT
with the selected variables.
#> Warning: Item 3 is of size 3 but maximum size is 5 (recycled leaving remainder of 2 items)select_which(DT, anyNA, .and.dots = "y")#> AB y #> 1: NA a #> 2: TRUE b #> 3: FALSE c #> 4: NA d #> 5: TRUE e