Skip to contents

Exclusion of samples, classes or features from an AnalysisData object.

Usage

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

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

removeFeatures(d, features = character())

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

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

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

Arguments

d

S4 object of class AnalysisData

cls

info column to use for class information

classes

classes to remove

features

features to remove

idx

info column containing sample indexes

samples

sample indexes to remove

Value

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

Methods

  • removeClasses: Remove classes.

  • removeFeatures: Remove features.

  • removeSamples: Remove samples.

Examples

library(metaboData)
 d <- analysisData(abr1$neg[,200:300],abr1$fact)
 
 ## Remove classes
 d %>% 
  removeClasses(cls = 'day',classes = 'H')
#> 
#> AnalysisData object containing:
#> 
#> Samples: 100 
#> Features: 101 
#> Info: 9 
#> 
 
 ## Remove features
 d %>% 
  removeFeatures(features = c('N200','N201'))
#> 
#> AnalysisData object containing:
#> 
#> Samples: 120 
#> Features: 99 
#> Info: 9 
#> 
 
 ## Remove samples
 d %>% 
  removeSamples(idx = 'injorder',samples = c(1,10))
#> 
#> AnalysisData object containing:
#> 
#> Samples: 118 
#> Features: 101 
#> Info: 9 
#>