Skip to contents

Nest a flowFrame into a flowSet

Usage

# S3 method for flowFrame
nest(.data, ..., .by = NULL, .key = NULL, .names_sep = NULL)

Arguments

.data

A flowFrame

...

Columns to nest; these will appear in the inner flowFrames comprising the output flowSet. Specified using name-variable pairs of the form new_col = c(col1, col2, col3). The right hand side can be any valid tidyselect expression. If not supplied, then ... is derived as all columns not selected by .by.

.by

Columns to nest by; these will be stored in the pData of the output flowSet. .by can be used in place of or in conjunction with columns supplied through .... If not supplied, then .by is derived as all columns not selected by ....

.key

Unused.

.names_sep

Unused.

Value

A flowSet wherein cells are grouped into constituent flowFrames based on which columns are used to nest.

Examples


my_flowframe <-
  simulate_cytometry_data()$flowframe |>
  dplyr::mutate(
    random_group =
      sample(
        c("a", "b"),
        size = nrow(simulate_cytometry_data()$flowframe),
        replace = TRUE
      )
  )
my_flowframe |>
  tidyr::nest(.by = random_group)
#> A flowSet with 2 experiments.
#> 
#> column names(10): feature_1 feature_2 ... feature_9 feature_10
#>