subsetSamples: Subset functions

subsetSamplesR Documentation

Subset functions

Description

To make a transition from phyloseq easier, the subsetSamples and subsetFeatures functions are implemented. To avoid name clashes they are named differently.

Usage

subsetSamples(x, ...)

subsetFeatures(x, ...)

subsetTaxa(x, ...)

## S4 method for signature 'SummarizedExperiment'
subsetSamples(x, ...)

## S4 method for signature 'SummarizedExperiment'
subsetFeatures(x, ...)

## S4 method for signature 'SummarizedExperiment'
subsetTaxa(x, ...)

Arguments

x

a SummarizedExperiment object

...

See subset. drop is not supported.

Details

However, the use of these functions is discouraged since subsetting using [ works on both dimension at the same time, is more flexible and is used throughout R to subset data with two or more dimension. Therefore, these functions will be removed in Bioconductor release 3.15 (April, 2022).

Value

A subset of x

Examples

data(GlobalPatterns)
subsetSamples(GlobalPatterns, colData(GlobalPatterns)$SampleType == "Soil")
# Vector that is used to specify subset must not include NAs 
subsetFeatures(GlobalPatterns, rowData(GlobalPatterns)$Phylum == "Actinobacteria" & 
               !is.na(rowData(GlobalPatterns)$Phylum))
               

microbiome/mia documentation built on April 27, 2024, 4:04 a.m.