Skip to contents

Keep rows that match a condition.

Usage

# S3 method for flowSet
filter(.data, ..., .by = NULL, .preserve = FALSE)

Arguments

.data

A flowSet

...

Expressions that return a logical value, and are defined in terms of the variables in the featureNames of the flowFrames in .data. If multiple expressions are included, they are combined with the & operator. Only rows for which all conditions evaluate to TRUE are kept.

.by

Optionally, a selection of columns to group by for just this operation, functioning as an alternative to group_by().

.preserve

Unused.

Value

An object of the same type as .data. The output has the following properties: * Rows are a subset of the input, but appear in the same order. * Columns are not modified. * The flowSet's pData will be preserved.

Examples

my_flowset <- simulate_cytometry_data()$flowset

my_flowset |>
  dplyr::filter(feature_1 > 50)
#> A flowSet with 5 experiments.
#> 
#> column names(10): feature_1 feature_2 ... feature_9 feature_10
#>