keep: Keep samples, classes or features

keepClassesR Documentation

Keep samples, classes or features

Description

Retain samples, classes or features in an AnalysisData object.

Usage

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

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

keepFeatures(d, features = character())

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

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

## S4 method for signature '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')
 
 ## Keep features
 d %>% 
  keepFeatures(features = c('N200','N201'))
 
 ## Keep samples
 d %>% 
  keepSamples(idx = 'injorder',samples = c(1,10))

jasenfinch/metabolyseR documentation built on Sept. 18, 2023, 1:25 a.m.