Skip to contents

Devides an experiment() into a list of experiment() objects by f.

Usage

# S3 method for class 'glyexp_experiment'
split(x, f, drop = FALSE, where = "var_info", ...)

Arguments

x

An experiment().

f

<data-masking> A column in var_info or sample_info that as.factor(f)defines the grouping.

drop

Logical indicating if levels that do not occur should be dropped. Defaults to FALSE.

where

Where to find the column, "var_info" or "sample_info".

...

Ignored

Value

A named list of experiment() objects.

Examples

split(toy_experiment, group, where = "sample_info")
#> $A
#> 
#> ── Glycoproteomics Experiment ──────────────────────────────────────────────────
#>  Expression matrix: 3 samples, 4 variables
#>  Sample information fields: group <chr>, batch <dbl>
#>  Variable information fields: protein <chr>, peptide <chr>, glycan_composition <chr>
#> 
#> $B
#> 
#> ── Glycoproteomics Experiment ──────────────────────────────────────────────────
#>  Expression matrix: 3 samples, 4 variables
#>  Sample information fields: group <chr>, batch <dbl>
#>  Variable information fields: protein <chr>, peptide <chr>, glycan_composition <chr>
#>