Helper to filter specifying the on
part of the data.table::data.table query.
An instance of ExprBuilder.
Key-value pairs, maybe with empty keys if the data.table
already has them. See
details.
Whether to negate the expression and search only for rows that don't contain the given values.
Logical. Should a new frame be automatically chained to the expression if the clause being set already exists?
If the input is a data.table
and .expr
is TRUE
, an instance of
EagerExprBuilder will be returned. Useful if you want to add clauses to j
, e.g. with
mutate-table.express.
The key-value pairs in '...' are processed as follows:
The names are used as on
in the data.table
frame. If any name is empty, on
is left
missing.
The values are packed in a list and used as i
in the data.table
frame.
To see more examples, check the vignette, or the table.express-package entry.
data("mtcars")
data.table::as.data.table(mtcars) %>%
filter_on(cyl = 4, gear = 5)
#> mpg cyl disp hp drat wt qsec vs am gear carb
#> 1: 26.0 4 120.3 91 4.43 2.140 16.7 0 1 5 2
#> 2: 30.4 4 95.1 113 3.77 1.513 16.9 1 1 5 2