envfit.coca: Fit an environmental vector or factor to a Co-CA ordination

envfit.cocaR Documentation

Fit an environmental vector or factor to a Co-CA ordination

Description

The function fits environmental vectors or factors to a Co-CA ordination. The projections of points onto vectors have maximum correlation with corresponding environmental variables, and the factors show the averages of factor levels.

Usage

## S3 method for class 'coca'
envfit(ord, env, which = c("response", "predictor"),
       choices = c(1, 2), scaling = FALSE, w, na.rm = FALSE,
       strata = NULL, permutations = 999, ...)

Arguments

ord

a Co-CA ordination object, the result of a call to coca.

env

a data frame, matrix or vector of environmental/external variable(s) to be fitted to the ordination. The variables may be of a mixed type (factors and continuous variables) in a data frame.

which

character; which of the response or predictor ordinations should be used during fitting of vectors and factors.

choices

numeric; the axes to which vectors and factors are fitted.

scaling

logical; should sacling be applied. See scores.symcoca.

w

weights used in fitting vectors and factors.

na.rm

Remove points with missing values in ordination scores or environmental variables. The operation is casewise; the whole row of data is removed if there is a missing value and na.rm = TRUE.

strata

An integer vector or factor specifying the strata for permutation. If supplied, observations are permuted only within the specified strata.

permutations

Number of permutations for assessing significance of vectors or factors. Set to 0 to skip permutations.

...

Arguments passed to vectorfit and factorfit.

Details

See envfit for details of the method.

Value

Returns an object of class envfit.

Author(s)

Gavin L. Simpson. The code interfaces with and uses code from envfit for the main computations, which was written by Jari Oksanen.

See Also

coca for fitting models. envfit for details of the generic function and the computations performed.

Examples

## symmetric CoCA
data(beetles)
data(plants)

## log transform the bettle data
beetles <- log(beetles + 1)

## fit the model
bp.sym <- coca(beetles ~ ., data = plants, method = "symmetric")

## load the environmental data
data(verges)

## fit vectors for the environmental data
sol <- envfit(bp.sym, verges, which = "response")
sol

## plot the response matrix and the fitted vectors
biplot(bp.sym, which = "y1")
plot(sol)

cocorresp documentation built on Oct. 7, 2024, 1:08 a.m.