Learn R Programming

vegan (version 1.6-0)

scores: Get Species or Site Scores from an Ordination

Description

Function to access either species or site scores for specified axes in some ordination methods.

Usage

## S3 method for class 'default':
scores(x, display=c("sites", "species"), choices, ...)

Arguments

x
An ordination result.
display
Partial match to access scores for sites or species.
choices
Ordination axes. If missing, returns all axes.
...
Other parameters (unused).

Value

  • The function returns a matrix of requested scores.

Details

Functions cca and decorana have specific scores function to access their ordination scores. Most standard ordination methods of libraries mva, multiv and MASS do not have a specificclass, and no specific method can be written for them. However, scores.default guesses where some commonly used functions keep their site scores and possible species scores. For site scores, the function seeks items in order points, rproj, x, and scores. For species, the seeking order is cproj, rotation, and loadings. If x is a matrix, scores.default returns the chosen columns of that matrix, ignoring whether species or sites were requested (do not regard this as a bug but as a feature, please). Currently the function seems to work at least for isoMDS, prcomp, princomp, ca, pca. It may work in other cases or fail mysteriously.

See Also

scores.cca, scores.decorana. These have somewhat different interface -- scores.cca in particular -- but all work with keywords display="sites" and display="species" and return a matrix with these.

Examples

Run this code
data(varespec)
library(mva)
vare.pca <- prcomp(varespec)
scores(vare.pca, choices=c(1,2))

Run the code above in your browser using DataLab