loadings {cocorresp}R Documentation

CoCA species loadings

Description

Extract CoCA species loadings from fitted objects.

Usage

loadings(x, ...)

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

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

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.

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.

Value

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

Author(s)

Gavin L. Simpson

See Also

coca for how to fit CoCA models.

Examples

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

[Package cocorresp version 0.4-3 Index]