plot_spider: Create an ordination with spiders based on 'spider_vec' and...

Description Usage Arguments Value Examples

View source: R/plot_spider.R

Description

Create an ordination with spiders based on spider_vec and coloring determined by col_vec.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
plot_spider(
  pca_rda_obj,
  spider_vec,
  col_vec,
  col_pal,
  mtitle = "",
  col_leg_pos = "bottomright",
  col_leg_title = "",
  sig_leg_pos = "topright",
  sig_leg = ""
)

Arguments

pca_rda_obj

Model object resulting from a call to rda. The proportion of variance explained by PC1 and PC2 is extracted with summary.

spider_vec

Vector of metadata for determining spiders.

col_vec

Vector of metadata for determining how points should be colored.

col_pal

Palette to use for the plot's color scheme. Note that it should be at least as long as the number of unique values in col_vec.

mtitle

The main title of the plot, defaults to an empty string.

col_leg_pos

Position to place the color legend, defaults to the bottom right corner. This should be adjusted if it overlaps any points.

col_leg_title

Title to be used for the color legend, defaults to an empty string, which results in no legend being shown.

sig_leg_pos

Position to place the significance legend, defaults to the top right corner. This should be adjusted if it overlaps any points.

sig_leg

Text describing the result of significance test, defaults to an empty string, which results in no legend being shown.

Value

A plot is displayed based on pca_rda_obj and the specified parameters.

Examples

1
2
3
4
5
plot_spider(pca_rda_obj = otu_exp1_pca, spider_vec = otu_exp1$Treatment_group,
    col_vec = otu_exp1$Organ, col_pal = my_pal,
    mtitle = "PCA of Experiment1 Samples by Treatment Group and Organ",
    col_leg_pos = "bottomright", col_leg_title = "Organ", sig_leg_pos = "topleft",
    sig_leg = "Difference between Treatment Groups:\n permanova: p < 0.0001")

cb-42/cbmbtools documentation built on Jan. 9, 2021, 1:38 a.m.