filter_on {table.express}R Documentation

Filter with secondary indices

Description

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

Usage

filter_on(.data, ...)

## S3 method for class 'ExprBuilder'
filter_on(
  .data,
  ...,
  which = FALSE,
  nomatch = getOption("datatable.nomatch"),
  mult = "all",
  .negate = FALSE,
  .chain = getOption("table.express.chain", TRUE)
)

## S3 method for class 'data.table'
filter_on(.data, ..., .expr = FALSE)

Arguments

.data

An instance of ExprBuilder.

...

Key-value pairs, maybe with empty keys if the data.table already has them. See details.

which, nomatch, mult

See data.table::data.table.

.negate

Whether to negate the expression and search only for rows that don't contain the given values.

.chain

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

.expr

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.

Details

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

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

Examples


data("mtcars")

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


[Package table.express version 0.4.2 Index]