Learn R Programming

ecodist (version 2.0.9)

min.nmds: Find minimum stress configuration

Description

Finds minimum stress configuration from output of nmds()

Usage

# S3 method for nmds
min(..., na.rm = FALSE, dims = 2)
nmds.min(x, dims = 2)

Value

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

Arguments

...

output from nmds()

x

output from nmds()

dims

desired dimensionality of result. If dims = 0 then the overall minimum stress configuration is chosen. By default, the best two-dimensional configuration is returned.

na.rm

Not used; there should be no NA values in a NMDS configuration.

Author

Sarah Goslee

Details

For back-compatibility, the nmds.min function remains.

See Also

nmds

Examples

Run this code

data(iris)
iris.d <- dist(iris[,1:4])

### nmds() is timeconsuming, so this was generated
### in advance and saved.
### set.seed(1234)
### iris.nmds <- nmds(iris.d, nits=20, mindim=1, maxdim=4)
### save(iris.nmds, file="ecodist/data/iris.nmds.rda")
data(iris.nmds)

# examine fit by number of dimensions
plot(iris.nmds)

# choose the best two-dimensional solution to work with
iris.nmin <- min(iris.nmds, dims=2)

Run the code above in your browser using DataLab