select_grep | R Documentation |
Select names matching a pattern
select_grep( DT, patterns, .and = NULL, .but.not = NULL, ignore.case = FALSE, perl = TRUE, fixed = FALSE, useBytes = FALSE, invert = FALSE, .warn.fixed.mismatch = TRUE )
DT |
A |
patterns |
Regular expressions to be matched against the names of |
.and |
Character or integer positions of names to select, regardless of whether or not they are matched by |
.but.not |
Character or integer positions of names to drop, regardless of whether or not they are matched by |
ignore.case, perl, fixed, useBytes, invert |
Arguments passed to |
.warn.fixed.mismatch |
(logical, default: |
DT
with the selected names.
integer vector of positions
library(data.table) dt <- data.table(x1 = 1, x2 = 2, y = 0) select_grep(dt, "x") select_grep(dt, "x", .and = "y") select_grep(dt, "x", .and = "y", .but.not = "x2")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.