Learn R Programming

vegan (version 1.6-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, permutations = 0, strata, choices=c(1,2))
## S3 method for class 'envfit':
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.

Value

  • Functions vectorfit and factorfit return lists of classes vectorfit and factorfit which have a print method. The result object have the following items:
  • arrowsArrow endpoints from vectorfit. The arrows are scaled to unit length.
  • centroidsClass centroids from factorfit.
  • rGoodness of fit statistic: Squared orrelation coefficient
  • permutationsNumber of permutations.
  • pvalsEmpirical 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.

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.

See Also

A better alternative to vectors may be ordisurf.

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

Run the code above in your browser using DataLab