Learn R Programming

vegan (version 1.4-0)

envfit: Fits an Environmental Vector or Factor onto an Ordination

Description

The function fits environmental vectors or factors onto an ordination. The projection of points onto vectors have maximum correlations with corresponding environmental variables, and the factors show the averages of factor levels.

Usage

envfit(X, P)
## S3 method for class 'envfit':
plot(x, choices = c(1,2), arrow.mul = 1, col = "blue", add = TRUE, ...)
vectorfit(X, P)
factorfit(X, P)

Arguments

X
Ordination configuration.
P
Matrix or vector of environmental variable(s).
x
A result object from envfit.
choices
Axes to plotted.
arrow.mul
Multiplier for vector lenghts.
col
Colour in plotting.
add
Results added to an existing ordination plot.
...
Parameters to text function.

Value

  • Function envfit returns an object of class envfit with items:
  • vectorsResult of vectorfit.
  • factorsResult of factorfit.
  • Function vectorfit returns a matrix where rows correspond to environmental variables and columns give the endpoints of environmental vectors (or their direction cosines), plus an extra column that gives the correlation coefficient to the fitted vector. The vectors are of unit length. Function factorfit returns a matrix where rows are factor levels. Function plot.envfit scales the vectors by correlation.

Details

Function envfit finds vectors or factor averages of environmental variabels. Function plot.envfit adds these in an ordination diagram. If X is a data.frame, envfit uses factorfit for factor variables and vectorfit for other variables. If X is a matrix or a vector, envfit uses only vectrofit. Functions vectorfit and factorfit can be called directly. Function vectorfit finds directions in the ordination space towards which the environmental vectors change most rapidly and to which they have maximal correlations with the ordination configuration. Function factorfit finds means of ordination scores for factor levels.

See Also

A better alternative to vectors may be surf.

Examples

Run this code
data(varespec)
data(varechem)
library(MASS)
library(mva)
vare.dist <- vegdist(wisconsin(varespec))
vare.mds <- isoMDS(vare.dist)
vare.mds <- postMDS(vare.mds, vare.dist)
vare.fit <- envfit(vare.mds$points, varechem)
plot(vare.mds$points, pch="+", asp=1, xlab="Dim1", ylab="Dim2")
plot(vare.fit)

Run the code above in your browser using DataLab