envfit(X, P, permutations = 0, strata, choices=c(1,2))
## S3 method for class 'envfit':
plot(x, choices = c(1,2), arrow.mul = 1, p.max = NULL,
col = "blue", add = TRUE, ...)
vectorfit(X, P, permutations = 0, strata, choices=c(1,2))
factorfit(X, P, permutations = 0, strata, choices=c(1,2))envfit.permutations to use this option.text function.vectorfit and factorfit return lists of
classes vectorfit and factorfit which have a
print method. The result object have the following items:vectorfit. The arrows are
scaled to unit length.factorfit.envfit returns a list of class envfit with
results of vectorfit and envfit as items.
Function plot.envfit scales the vectors by correlation.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.
ordisurf.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
ordiplot(vare.mds)
plot(vare.fit)
plot(vare.fit, p.max = 0.05, col = "red")Run the code above in your browser using DataLab