Skip to contents

Split an object of class AnalysisData into a list based a class grouping variable.

Usage

split(x, cls = "class")

# S4 method for AnalysisData
split(x, cls = "class")

Arguments

x

S4 object of class AnalysisData

cls

sample information column to use for splitting

Value

A list of AnalysisData objects.

Examples

library(metaboData)

d <- analysisData(abr1$neg,abr1$fact)

## Split the data set based on the 'day' class information column
d <- split(d,cls = 'day')

print(d)
#> $`1`
#> 
#> AnalysisData object containing:
#> 
#> Samples: 20 
#> Features: 2000 
#> Info: 9 
#> 
#> 
#> $`2`
#> 
#> AnalysisData object containing:
#> 
#> Samples: 20 
#> Features: 2000 
#> Info: 9 
#> 
#> 
#> $`3`
#> 
#> AnalysisData object containing:
#> 
#> Samples: 20 
#> Features: 2000 
#> Info: 9 
#> 
#> 
#> $`4`
#> 
#> AnalysisData object containing:
#> 
#> Samples: 20 
#> Features: 2000 
#> Info: 9 
#> 
#> 
#> $`5`
#> 
#> AnalysisData object containing:
#> 
#> Samples: 20 
#> Features: 2000 
#> Info: 9 
#> 
#> 
#> $H
#> 
#> AnalysisData object containing:
#> 
#> Samples: 20 
#> Features: 2000 
#> Info: 9 
#> 
#>