Skip to contents

Subset rows using their positions

Usage

# S3 method for flowFrame
slice(.data, ..., .by = NULL, .preserve = FALSE)

Arguments

.data

A flowFrame

...

Integer row values (to keep).

.by

Optionally, an unquoted selection of columns to group by for just this operation. An alternative to group_by.

.preserve

Currently unused.

Value

An object of the same type as .data. The output has the following properties: * Each row may appear 0, 1, or many times in the output. * Columns are not modified. * Groups are not modified. * A flowSet's pData is preserved.

Examples


my_flowframe <- simulate_cytometry_data()$flowframe

 my_flowframe |>
   dplyr::slice(1)
#> flowFrame object 'V1'
#> with 1 cells and 10 observables:
#>            name       desc     range  minRange  maxRange
#> $P1   feature_1  feature_1        75         0        74
#> $P2   feature_2  feature_2        84         0        83
#> $P3   feature_3  feature_3        43         0        42
#> $P4   feature_4  feature_4        48         0        47
#> $P5   feature_5  feature_5        76         0        75
#> $P6   feature_6  feature_6        51         0        50
#> $P7   feature_7  feature_7        18         0        17
#> $P8   feature_8  feature_8        62         0        61
#> $P9   feature_9  feature_9       101         0       100
#> $P10 feature_10 feature_10        99         0        98
#> 88 keywords are stored in the 'description' slot