View source: R/plot_ordination_utils.R
plot_ordination_utils | R Documentation |
This function extends the plot_ordination function of phyloseq
to highlight the top taxa loadings
on the species ordination.
plot_ordination_utils( x, ordiObject, color.opt = NULL, plot.arrow = TRUE, scale.arrow = NULL, top.taxa = 5 )
x |
|
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. |
This function is useful for visualizing specifc taxa that could be important in explaining variations in ordinations.
plot
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.