pcoa_phyloseq: Create a ggplot object of the PCoA from a phyloseq object....

View source: R/pcoa_phyloseq.R

pcoa_phyloseqR Documentation

Create a ggplot object of the PCoA from a phyloseq object. Function from the phylosmith-package.

Description

Inputs a phyloseq-class object and plots the PCoA of a treatment or set of treatments in space.

Usage

pcoa_phyloseq(phyloseq_obj, treatment, x = 1, y = 2, method = 'bray',
circle = 0.95, colors = 'default', labels = NULL)

Arguments

phyloseq_obj

A phyloseq-class object. It must contain sample_data()) with information about each sample, and it must contain tax_table()) with information about each taxa/gene.

treatment

Column name as a string or number in the sample_data. This can be a vector of multiple columns and they will be combined into a new column.

x

the numerical principle compenent to use as the x-axis

y

the numerical principle compenent to use as the y-axis

method

the distance measurement algorithm to use, match to "euclidean", "manhattan", "canberra", "clark", "bray", "kulczynski", "jaccard", "gower", "altGower", "morisita", "horn", "mountford", "raup", "binomial", "chao", "cao" or "mahalanobis".

circle

If TRUE, a stat_ellipse around each of the treatment factors (TRUE). If numeric between 0 and 1, will add ellipse of confidence interval equal to value given (i.e. 0.95 produces ellipses of 95% confidence intervals)

colors

Name of a color set from the RColorBrewer package or a vector palette of R-accepted colors.

labels

Column name as a string or number in the sample_data to use to place labels of that factor instead of circle points.

Value

ggplot-object

Examples

pcoa_phyloseq(soil_column, c('Matrix', 'Treatment'),
circle = TRUE)

schuyler-smith/phylosmith documentation built on Aug. 17, 2024, 10:19 a.m.