Keep rows that match a condition.
Usage
# S3 method for flowFrame
filter(.data, ..., .by = NULL, .preserve = FALSE)
Arguments
- .data
- ...
Expressions that return a logical value, and are defined in terms of the variables in the
featureNames
of .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 flowFrame
's identifier
will be preserved.
Examples
my_flowframe <- simulate_cytometry_data()$flowframe
my_flowframe |>
dplyr::filter(feature_1 > 50)
#> flowFrame object 'V1'
#> with 42 cells and 10 observables:
#> name desc range minRange maxRange
#> $P1 feature_1 feature_1 101 0 100
#> $P2 feature_2 feature_2 100 0 99
#> $P3 feature_3 feature_3 97 0 96
#> $P4 feature_4 feature_4 101 0 100
#> $P5 feature_5 feature_5 101 0 100
#> $P6 feature_6 feature_6 99 0 98
#> $P7 feature_7 feature_7 93 0 92
#> $P8 feature_8 feature_8 99 0 98
#> $P9 feature_9 feature_9 98 0 97
#> $P10 feature_10 feature_10 99 0 98
#> 88 keywords are stored in the 'description' slot