phyloseq_sep_variable: Split phyloseq-class object by sample-level variable.

View source: R/phyloseq_sep_variable.R

phyloseq_sep_variableR Documentation

Split phyloseq-class object by sample-level variable.

Description

This function splits a phyloseq object by sample meta-data, returning a list of objects whose components each correspond to a group of samples.

Usage

phyloseq_sep_variable(physeq, variable, drop_zeroes = T)

Arguments

physeq

A phyloseq-class object

variable

Variable name (contained in sample_data)

drop_zeroes

Logical, indicating weather OTUs with zero abundance withing a group of samples should be removed

Value

List with phyloseq objects.

Examples

data(GlobalPatterns)

# Split data by sample type (e.g., Soil, Ocean, etc.)
phyloseq_sep_variable(GlobalPatterns, variable = "SampleType")

# Do not remove OTUs with total zero abundance within each sample type
phyloseq_sep_variable(GlobalPatterns, variable = "SampleType", drop_zeroes = FALSE)


vmikk/metagMisc documentation built on Feb. 14, 2024, 2:29 a.m.