plot_ordination_utils: Plot species loading with ordinations

Description Usage Arguments Details Value Examples

View source: R/plot_ordination_utils.R

Description

This function extends the plot_ordination function of phyloseqto highlight the top taxa loadings on the species ordination.

Usage

1
2
plot_ordination_utils(x, ordiObject, color.opt = NULL,
  plot.arrow = TRUE, scale.arrow = NULL, top.taxa = 5)

Arguments

x

phyloseq-class object

ordiObject

Output of ordinate from package phyloseq. Only NMDS/CCA and Bray supported.

color.opt

Variable of interest from metadata.

plot.arrow

If arrow should be plotted for species either TRUE or FALSE.

scale.arrow

If arrow is plotted a constant to multiply axis values for clearing visualisations.

top.taxa

Top varying taxa to plot, default is 5.

Details

This function is useful for visualizing specifc taxa that could be important in explaining variations in ordinations.

Value

plot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run: 

library(microbiomeutilities)
library(RColorBrewer)
data("zackular2014")
ps1 <- zackular2014
ps2 <- tax_glom(ps1, "Genus")
ps2f <- format_to_besthit(ps2)
orddi <- ordinate(ps2f, method = "CCA", distance = "bray")
p <- plot_ordination_utils(ps2f, orddi,
  color = "DiseaseState", plot.arrow = TRUE,
  scale.arrow = 1.3, top.taxa = 5
)
print(p)

## End(Not run)

microsud/microbiomeutilities documentation built on Feb. 5, 2020, 11:19 p.m.