Skip to contents

Unnest a flowSet into a single flowFrame

Usage

# S3 method for flowSet
unnest(
  data,
  cols,
  ...,
  keep_empty = FALSE,
  ptype = NULL,
  names_sep = NULL,
  names_repair = "check_unique"
)

Arguments

data

A flowSet

cols

Columns in pData to unnest.

...

Unused.

keep_empty

Unused.

ptype

Unused.

names_sep

Unused.

names_repair

Unused.

Value

A flowFrame or flowSet

depending on the degree of unnest-ing. Note that unnest-ing and ungrouping a flowSet are equivalent.

Examples

my_flowset <- simulate_cytometry_data()$flowset

my_flowset |>
  tidyr::unnest(cols = c(patient, cell_type))
#> flowFrame object 'tidyFlowCore_id_1'
#> with 500 cells and 13 observables:
#>                    name               desc     range  minRange  maxRange
#> $P1           feature_1          feature_1       101         0       100
#> $P2           feature_2          feature_2       101         0       100
#> $P3           feature_3          feature_3       101         0       100
#> $P4           feature_4          feature_4       101         0       100
#> $P5           feature_5          feature_5       101         0       100
#> ...                 ...                ...       ...       ...       ...
#> $P9           feature_9          feature_9       101         0       100
#> $P10         feature_10         feature_10       101         0       100
#> $P11            patient            patient         4         0         3
#> $P12          cell_type          cell_type         3         0         2
#> $P13 .tidyFlowCore_name .tidyFlowCore_name         6         0         5
#> 110 keywords are stored in the 'description' slot

my_flowset |>
  tidyr::unnest(cols = patient)
#> A flowSet with 2 experiments.
#> 
#> column names(12): feature_1 feature_2 ... patient .tidyFlowCore_name
#>