scores {vegan} | R Documentation

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

    ## Default S3 method:
    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).

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

### Value

The function returns a matrix of requested scores.

### Author(s)

Jari Oksanen

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

    data(varespec)
    vare.pca <- prcomp(varespec)
    scores(vare.pca, choices=c(1,2))

[Package vegan version 1.8-6 Index]