Description Usage Arguments Details Value Author(s) Examples
This function creates an NMDS plot for a beta diversity object from vegan.
1 2 | pmartRseq_NMDS(res, omicsData, grp, k, x_axis = "NMDS1", y_axis = "NMDS2",
ellipses = TRUE)
|
res |
an object created by vegan::metaMDS |
omicsData |
a seqData object |
grp |
name of column to use for grouping variables |
k |
number of dimensions |
x_axis |
which dimension to put on the x-axis |
y_axis |
which dimension to put on the y-axis |
ellipses |
logical indicating whether or not to show ellipses on the plot |
After beta diversity is calculated, this function will create a plot of the results, along with ellipses, to show the different groupings.
An NMDS plot of a beta diversity index.
Allison Thompson
1 2 3 4 5 6 7 8 9 10 11 | ## Not run:
library(mintJansson)
library(vegan)
data(rRNA_data)
rRNA_data <- group_designation(omicsData = rRNA_data, main_effects = c("treatment"))
rRNA_norm <- normalize_data(omicsData = rRNA_data, norm_fn = "css", normalize = TRUE)
rRNA_veg <- pmartRseq_to_vegan(omicsData = rRNA_norm)
rRNA_metamds <- vegan::metaMDS(rRNA_veg, distance = "bray", k = 4, autotransform = FALSE, na.rm = TRUE)
pmartRseq_NMDS(rRNA_metamds, as.factor(attr(rRNA_norm,"group_DF")[match(rownames(rRNA_veg),attr(rRNA_norm,"group_DF")[,attr(rRNA_norm,"cnames")$fdata_cname]),"Group"]))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.