scores {vegan} | R Documentation |
Function to access either species or site scores for specified axes in some ordination methods.
## Default S3 method: scores(x, choices, display=c("sites", "species"), ...)
x |
An ordination result. |
choices |
Ordination axes. If missing, returns all axes. |
display |
Partial match to access scores for sites or
species . |
... |
Other parameters (unused). |
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 specific class
, 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.
The function returns a matrix of requested scores.
Jari Oksanen
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.
data(varespec) vare.pca <- prcomp(varespec) scores(vare.pca, choices=c(1,2))