plotPCA: Function to calculate and plot a PCA comparing sample groups...

View source: R/plotPCA.r

plotPCAR Documentation

Function to calculate and plot a PCA comparing sample groups at the whole community level.

Description

Function to calculate and plot a PCA comparing sample groups at the whole community level.

Usage

plotPCA(cds, soi = NULL, perm = 100, cutoff = 0.05, rowLabs = NULL,
  subtitle = NULL, cols = 1:2, showLegend = TRUE,
  showArrows = TRUE, showHull = FALSE, showSidebars = FALSE,
  showTitle = TRUE, calcSpread = TRUE)

Arguments

cds

A compatible data set produced by the makeCDS() function.

soi

A vector containing the names of the strains of interest, matching row names of the CDS count table.

perm

The number of permutations for the PERMANOVA, passed to the adonis() function.

cutoff

A p-value cutoff to determine which strains will be included individually in the plot.

rowLabs

A vector of names for the strains of interest, for plotting.

subtitle

A subtitle for the plot.

cols

A vector of 2 colours for the points.

showLegend

A logical indicating whether or not to show a legend.

showArrows

A logical indicating whether or not to show the top 3 or fewer significant individual responses

showHull

A logical indicating whether or not to highlight the hull of each set of points

showSidebars

A logical indicating whether or not to add box-and-whisker plots per group beside the axes

showTitle

A logical indicating whether or not to show a plot title.

calcSpread

A logical indicating whether or not to calculate the spread of each group of points

Details

The spread of points is given as a vector of distances from each point in the group to that group's centroid.

Value

The results of the PCA and the adonis() function, and optionally the spread of points in each group.

Author(s)

Chris Field <fieldc@ethz.ch>

Examples

None

cmfield/phylloR documentation built on Aug. 25, 2023, 10:07 a.m.