select_which | R Documentation |
Select columns satisfying a condition
select_which(DT, Which, .and.dots = NULL, checkDT = TRUE, .and.grep = NULL)
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 |
DT
with the selected variables.
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.