pmartRseq_NMDS: NMDS plot for beta diversity

Description Usage Arguments Details Value Author(s) Examples

Description

This function creates an NMDS plot for a beta diversity object from vegan.

Usage

1
2
pmartRseq_NMDS(res, omicsData, grp, k, x_axis = "NMDS1", y_axis = "NMDS2",
  ellipses = TRUE)

Arguments

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

Details

After beta diversity is calculated, this function will create a plot of the results, along with ellipses, to show the different groupings.

Value

An NMDS plot of a beta diversity index.

Author(s)

Allison Thompson

Examples

 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)

pmartR/pmartRseq documentation built on May 25, 2019, 9:20 a.m.