envfit                 package:vegan                 R Documentation

_F_i_t_s _a_n _E_n_v_i_r_o_n_m_e_n_t_a_l _V_e_c_t_o_r _o_r _F_a_c_t_o_r _o_n_t_o _a_n _O_r_d_i_n_a_t_i_o_n

_D_e_s_c_r_i_p_t_i_o_n:

     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.

_U_s_a_g_e:

     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))

_A_r_g_u_m_e_n_t_s:

       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.

   p.max: Maximum estimated P value for displayed variables.  You must
          calculate P values with setting 'permutations' to use this
          option. 

     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.

_D_e_t_a_i_l_s:

     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.

_V_a_l_u_e:

     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.

_N_o_t_e:

     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.

_A_u_t_h_o_r(_s):

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

_S_e_e _A_l_s_o:

     A better alternative to vectors may be 'ordisurf'.

_E_x_a_m_p_l_e_s:

     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")

