Learn R Programming

table.express (version 0.1.1)

filter_on: Filter with secondary indices

Description

Helper to filter specifying the on part of the data.table::data.table query.

Usage

filter_on(.data, ..., nomatch = getOption("datatable.nomatch"),
  mult = "all", .chain = getOption("table.express.chain", TRUE))

Arguments

.data

An instance of ExprBuilder.

...

Key-value pairs, see details.

.chain

Logical. Should a new frame be automatically chained to the expression if the clause being set already exists?

Details

The key-value pairs in '...' are processed as follows:

  • The names are used as on in the data.table frame.

  • The values are packed in a list and used as i in the data.table frame.

Thus, all pairs must be named.

To see more examples, check the vignette, or the table.express-package entry.

Examples

Run this code
# NOT RUN {
data("mtcars")

data.table::as.data.table(mtcars) %>%
    start_expr %>%
    filter_on(cyl = 4, gear = 5)

# }

Run the code above in your browser using DataLab