Learn R Programming

cocorresp (version 0.4-4)

loadings: CoCA species loadings

Description

Extract CoCA species loadings from fitted objects.

Usage

loadings(x, ...)

# S3 method for predcoca loadings(x, choices = c(1, 2), which = c("response", "predictor"), ...)

# S3 method for symcoca loadings(x, choices = c(1, 2), which = c("y1", "y2"), ...)

Value

A list of data frames or a single data frame depending on other arguments.

Arguments

x

an object resulting from a call to coca.

choices

numeric; vector of Co-CA axes to extract loadings for.

which

character; should the response or predictor scores be plotted. Can be specified in several ways: response choices are one from c("y", "Y", "y1", "response"); predictor choices are one from c("x", "X", "y2", "predictor").

...

additional arguments to be passed to lower level methods.

Author

Gavin L. Simpson

Details

loadings() is an extractor function to access the loadings of a fitted CoCA model.

This is a generic function, replacing the loadings function, which is preserved as the exported default S3 method. Methods are provided for both predictive and symmetric CoCA.

See Also

coca for how to fit CoCA models.

Examples

Run this code
## symmetric CoCA
data(beetles)
## log transform the bettle data
beetles <- log(beetles + 1)
data(plants)
## fit the model
bp.sym <- coca(beetles ~ ., data = plants, method = "symmetric")

## extract the loadings
lds <- loadings(bp.sym)

Run the code above in your browser using DataLab