envfit {vegan}R Documentation

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, permutations = 0, strata, choices=c(1,2))
plot(x, choices = c(1,2), arrow.mul = 1, col = "blue", add = TRUE, ...)
vectorfit(X, P, permutations = 0, strata, choices=c(1,2))
factorfit(X, P, permutations = 0, strata, choices=c(1,2))

Arguments

X Ordination configuration.
P Matrix or vector of environmental variable(s).
permutations Number of permutations for assessing significance of vectors or factors.
x A result object from envfit.
choices Axes to plotted.
arrow.mul Multiplier for vector lengths.
col Colour in plotting.
add Results added to an existing ordination plot.
strata An integer vector or factor specifying the strata for permutation. If supplied, observations are permuted only within the specified strata.
... Parameters to text function.

Details

Function envfit finds vectors or factor averages of environmental variables. 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 vectorfit.

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 averages of ordination scores for factor levels.

If permutations > 0, the `significance' of fitted vectors or factors is assessed using permutation of environmental variables. The goodness of fit statistic is squared correlation coefficient (r^2). For factors this is defined as r^2 = 1 - ss_w/ss_t, where ss_w and ss_t are within-group and total sums of squares.

Value

Functions vectorfit and factorfit return lists of classes vectorfit and factorfit which have a print method. The result object have the following items:

arrows Arrow endpoints from vectorfit. The arrows are scaled to unit length.
centroids Class centroids from factorfit.
r Goodness of fit statistic: Squared orrelation coefficient
permutations Number of permutations.
pvals Empirical P-values for each variable.


Function envfit returns a list of class envfit with results of vectorfit and envfit as items.
Function plot.envfit scales the vectors by correlation.

Note

Fitted vectors have become the method of choice in displaying environmental variables in ordination. Indeed, they are the optimal way of presenting environmental variables in Constrained Correspondence Analysis cca, since there they are the linear constraints. In unconstrained ordination the relation between external variables and ordination configuration may be less linear, and therefore other methods than arrows may be more useful. The simplest is to adjust the plotting symbol sizes (cex, symbols) by environmental variables. Fancier methods involve smoothing and regression methods that abound in R, and ordisurf provides a wrapper for some.

Author(s)

Jari Oksanen. The permutation test derives from the code suggested by Michael Scroggie.

See Also

A better alternative to vectors may be ordisurf.

Examples

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, 1000)
vare.fit
plot(vare.mds$points, pch="+", asp=1, xlab="Dim1", ylab="Dim2")
plot(vare.fit)

[Package Contents]