Learn R Programming

vegan (version 2.0-10)

MDSrotate: Rotate First MDS Dimension Parallel to an External Variable

Description

Function rotates a multidimensional scaling result so that its first dimension is parallel to an external (environmental variable). The function can handle the results from metaMDS or monoMDS functions.

Usage

MDSrotate(object, vec, na.rm = FALSE, ...)

Arguments

object
A result object from metaMDS or monoMDS.
vec
A continuous environmental variable (vector of the same length as the number of points).
na.rm
Remove missing values from the continuous variable vec.
...
Other arguments (ignored).

Value

  • Function returns the original ordination result, but with rotated scores (both site and species if available), and the pc attribute of scores set to FALSE.

Details

The orientation and rotation are undefined in multidimensional scaling. Functions metaMDS and metaMDS can rotate their solutions to principal components so that the dispersion of the points is highest on the first dimension. Sometimes a different rotation is more intuitive, and MDSrotate allows rotation of the result so that the first axis is parallel to a given external variable.

See Also

metaMDS, monoMDS.

Examples

Run this code
data(varespec)
data(varechem)
mod <- monoMDS(vegdist(varespec))
mod <- with(varechem, MDSrotate(mod, pH))
plot(mod)
ef <- envfit(mod ~ pH, varechem, permutations = 0)
plot(ef)
ordisurf(mod ~ pH, varechem, knots = 1, add = TRUE)

Run the code above in your browser using DataLab