NMSrandom: Calculate the NMS Result with the Smallest Stress from...

NMSrandomR Documentation

Calculate the NMS Result with the Smallest Stress from Various Random Starts

Description

This function provides a simplified version of the method of calculating NMS results implemented by the function metaMDS (vegan).

Usage

NMSrandom(x,perm=100,k=2,stressresult=F,method="isoMDS")

Arguments

x

Distance matrix.

perm

Number of permutations to select the configuration with the lowest stress.

k

Number of dimensions for the non metric scaling result; passed to isoMDS or sammon.

stressresult

Provide the calculated stress for each permutation.

method

Method for calculating the NMS: isoMDS or sammon.

Details

This function is an easier method of calculating the best NMS configuration after various random starts than implemented in the metaMDS function (vegan). The function uses a distance matrix (as calculated for example by function vegdist from a community data set) and calculates random starting positions by function initMDS (vegan) analogous to metaMDS.

Value

The function returns the NMS ordination result with the lowest stress (calculated by isoMDS or sammon.), or the stress of each NMS ordination.

Author(s)

Roeland Kindt (World Agroforestry Centre)

References

Kindt, R. & Coe, R. (2005) Tree diversity analysis: A manual and software for common statistical methods for ecological and biodiversity studies.

https://www.worldagroforestry.org/output/tree-diversity-analysis

Examples

library(vegan)
library(MASS)
data(dune)
distmatrix <- vegdist(dune)
Ordination.model1 <- NMSrandom(distmatrix, perm=100, k=2)
Ordination.model1 <- add.spec.scores(Ordination.model1, dune, 
    method='wa.scores')
Ordination.model1

BiodiversityR documentation built on June 22, 2024, 11:57 a.m.