sensiNMDS: Sensitivity analysis for the selection of species for NMDSs

Description Usage Arguments Details Value Examples

View source: R/ScriptHomemadeFunctions.R

Description

This function performs a sensitivity analysis to choose the combination of species to keep in an ecological dataset to optimize the stress in NMDS analyses. This function works with the rar.rm_V2 function.As a consequence, sensiNMDS() performs a NMDS for each possible combination of species removal in terms of abundance (of a species in a given site) and number of colonized sites (by that species), as in rar.rm_V2.

Usage

1
sensiNMDS(MYDATA, TREATMENT, NB_DIM)

Arguments

MYDATA

A contingency table (a purely numeric species-site matrix).

TREATMENT

A factor with a length matching the number of samples (i.e. the number of lines of MYDATA). Typically, a factor representing a given treatment associated to the different samples/sites. In fact, this argument is not used in the current version of the function, but is required because it is called by hidden and inactive parts of the source code (useful for simulation studies). If you do not have such a factor, you can easily generate one (see Example section below).

NB_DIM

The desired number of dimensions kept in the NMDS analyses (>1). Usually, 2 or 3. The number of dimensions kept depends on the quality of the data.

Details

For time-efficiency reasons, the functions currently only tests for a predefined limited number of combinations of possible abundances (i.e. accounted for by the ABUN argument in the rar.rm_V2 function) with a maximal value set to 40 (i.e. a species has to be observed 40 times to be kept). For additional values, please contact me.
The NMDSs are performed using the metaMDS function in the vegan package.

Value

A graph showing the behaviour of NMDSs' stress for each combination of species removal.

Examples

1
2
3
4
5
6
 ## For a simulated matrix with 20 lines (sites) and
## 30 columns (species), split in 2 treatments:
library(vegan)
data(dune)
mytreatment <- gl(2, 10)
sensiNMDS(MYDATA = dune, TREATMENT = mytreatment, NB_DIM = 2)

mrelnoob/airpoumpoum documentation built on Feb. 11, 2020, 8:19 p.m.