
Split an experiment
split.glyexp_experiment.RdDevides 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 invar_infoorsample_infothatas.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
#>
#> ── Others 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
#>
#> ── Others Experiment ───────────────────────────────────────────────────────────
#> ℹ Expression matrix: 3 samples, 4 variables
#> ℹ Sample information fields: group <chr>, batch <dbl>
#> ℹ Variable information fields: protein <chr>, peptide <chr>, glycan_composition <chr>
#>