NMDS_ellipse: Generate NMDS points, group centroids and standard error...

Description Usage Arguments Value Examples

View source: R/functions.R

Description

Generate NMDS points, group centroids and standard error ellipses

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
NMDS_ellipse(
  metadata,
  OTU_table,
  grouping_set,
  distance_method = "bray",
  rand_seed = 77777,
  MDS_trymax = 1000,
  autotransform = FALSE,
  wascores = TRUE,
  expand = FALSE
)

Arguments

metadata

A dataframe containing the metadata relating to the samples in your OTU table. Seems to break if this dataframe only has 1 column.

OTU_table

an OTU table with samples as rows and taxa as columns

grouping_set

a column name from your metadata. This column should contain information about how your samples should be grouped for centroid and ellipse calculation

distance_method

a single text value that describes the desired distance metric to use, must be accepted by the function vegdist()

rand_seed

numeric value to use as a random seed (for reproducability?)

MDS_trymax

number of iterations to use for the metaMDS call, default is 1000

autotransform

passed to vegan's metaMDS, should community data be transformed? Should be TRUE/FALSE. Default = FALSE

wascores

passed to vegan's metaMDS, should species scores be calculated? Should be TRUE/FALSE. Default = TRUE

expand

passed to vegan's metaMDS, should species scores be expanded?

Value

Returns a list containing 3 items. [[1]] = input metadata with NMDS coordinates, group centroid coordinates for each sample. [[2]] = a dataframe containing information about the standard error confidence ellipses for each group. This datafame contains 100 points per group and is suitable for using with geom_path(). [[3]] = the ordination object created by the vegan function metaMDS().

Examples

1
#soon

Jtrachsel/funfuns documentation built on Aug. 8, 2021, 7:31 p.m.