Home

envfit

Envfit is a function in the vegan package for the R programming language used to relate environmental variables to an ordination, such as NMDS, PCA, or RDA. It helps interpret patterns in community composition by identifying which measured environmental factors align with the observed gradient and how strongly they do so. The function can fit both continuous variables and categorical factors, providing a visual and statistical link between the environment and the ordination results.

For continuous environmental variables, envfit fits vectors (arrows) in the ordination space. The length and direction

The output is an envfit object containing results for both vectors and factors, including r2 values and

Usage typically involves providing an ordination object and a data frame or matrix of environmental variables,

of
each
arrow
reflect
the
strength
and
orientation
of
the
relationship
between
the
variable
and
the
ordination
axes,
with
longer
arrows
indicating
stronger
associations.
The
squared
correlation
(r2)
quantifies
the
strength,
and
a
permutation
test
yields
a
p-value
to
assess
statistical
significance.
For
categorical
variables,
envfit
fits
the
centroids
of
groups
in
the
ordination
space
and
tests
whether
group
differences
along
the
ordination
are
greater
than
expected
by
chance;
results
can
be
displayed
as
points
or
as
fitted
vectors,
depending
on
the
option
chosen.
p-values
for
each
variable
or
factor
level,
along
with
coordinates
for
plotting.
The
object
can
be
printed
or
plotted
on
top
of
an
existing
ordination,
enabling
straightforward
interpretation
of
which
environmental
factors
are
most
strongly
associated
with
the
observed
patterns.
with
an
optional
perm
argument
to
control
permutation
testing.
Envfit
is
widely
used
in
ecology
for
exploratory
analysis
to
link
species
data
to
environmental
gradients.