Learn R Programming

ecodist (version 1.2.9)

nmds.min: Find minimum stress configuration

Description

Finds minimum stress configuration from output of nmds()

Usage

nmds.min(x, dims = 0)

Arguments

x

output from nmds()

dims

desired dimensionality of result. If dims == 0 (the default) then the overall minimum stress configuration is chosen.

Value

Configuration of minimum stress ordination (dataframe of coordinates). The stress and r^2 for the minimum stress configuration are stored as attributes.

See Also

nmds

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
# Example of multivariate analysis using built-in iris dataset
data(iris)
iris <- iris[seq(1, 150, by=3),]
iris.md <- distance(iris[,1:4], "mahal")

# Minimum-stress 2-dimensional nonmetric multidimensional scaling configuration
# Uses small number of separate ordinations (5) to increase speed of example.
# Use more for final analysis.
iris.nmds <- nmds(iris.md, mindim=2, maxdim=2, nits=3)
iris.nmin <- nmds.min(iris.nmds)

# Plot NMDS result with symbols denoting species
plot(iris.nmin, pch=as.numeric(iris[,5]))

# Fit vectors for the main variables to the NMDS configuration
iris.vf <- vf(iris.nmin, iris[,1:4], nperm=10)
plot(iris.vf, col="blue")
# }

Run the code above in your browser using DataLab