Skip to contents

Retain samples, classes or features in an AnalysisData object.

Usage

keepClasses(d, cls = "class", classes = c())

# S4 method for AnalysisData
keepClasses(d, cls = "class", classes = c())

keepFeatures(d, features = character())

# S4 method for AnalysisData
keepFeatures(d, features = character())

keepSamples(d, idx = "fileOrder", samples = c())

# S4 method for AnalysisData
keepSamples(d, idx = "fileOrder", samples = c())

Arguments

d

S4 object of class AnalysisData

cls

info column to use for class information

classes

classes to keep

features

features to remove

idx

info column containing sample indexes

samples

sample indexes to keep

Value

An S4 object of class AnalysisData with specified samples, classes or features retained.

Methods

  • keepClasses: Keep classes.

  • keepFeatures: Keep features.

  • keepSamples: Keep samples.

Examples

library(metaboData)
 d <- analysisData(abr1$neg[,200:300],abr1$fact)
 
 ## Keep classes
 d %>% 
  keepClasses(cls = 'day',classes = 'H')
#> 
#> AnalysisData object containing:
#> 
#> Samples: 20 
#> Features: 101 
#> Info: 9 
#> 
 
 ## Keep features
 d %>% 
  keepFeatures(features = c('N200','N201'))
#> 
#> AnalysisData object containing:
#> 
#> Samples: 120 
#> Features: 2 
#> Info: 9 
#> 
 
 ## Keep samples
 d %>% 
  keepSamples(idx = 'injorder',samples = c(1,10))
#> 
#> AnalysisData object containing:
#> 
#> Samples: 2 
#> Features: 101 
#> Info: 9 
#>