Learn R Programming

BiodiversityR (version 1.5)

add.spec.scores: Add Species Scores to Unconstrained Ordination Results

Description

Calculates scores (coordinates) to plot species for PCoA or NMS results that do not naturally provide species scores. The function can also rescale PCA results to use the choice of rescaling used in vegan for the rda function (after calculating PCA results via PCoA with the euclidean distance first).

Usage

add.spec.scores(ordi,comm,method="cor.scores",multi=1,Rscale=F,scaling="1")

Arguments

ordi
Ordination result as calculated by cmdscale, isoMDS, sammon,
comm
Community data frame with sites as rows, species as columns and species abundance as cell values.
method
Method for calculating species scores. Method "cor.scores" calculates the scores by the correlation between site scores and species vectors (via function cor), method "wa.scores" calculates the weighted av
multi
Multiplier for the species scores.
Rscale
Use the same scaling method used by vegan for rda.
scaling
Scaling method as used by rda.

Value

  • The function returns a new ordination result with new information on species scores. For PCoA results, the function calculates eigenvalues (not sums-of-squares as provided in results from function cmdscale), the percentage of explained variance per axis and the sum of all eigenvalues. PCA results (obtained by PCoA obtained by function cmdscale with the Euclidean distance) can be scaled as in function rda, or be left at the original scale.

References

Kindt, R. & Coe, R. (2005) Tree diversity analysis: A manual and software for common statistical methods for ecological and biodiversity studies. http://www.worldagroforestry.org/resources/databases/tree-diversity-analysis

Examples

Run this code
library(vegan)
data(dune)
distmatrix <- vegdist(dune, method='euc')
## Principal coordinates analysis with 19 axes to estimate total variance
Ordination.model1 <- cmdscale(distmatrix, k=19, eig=TRUE, add=FALSE)
Ordination.model1 <- add.spec.scores(Ordination.model1,dune, method='pcoa.scores', Rscale=TRUE, scaling=1, multi=1)
Ordination.model1
## Compare Ordination.model1 with:
Ordination.model2 <- rda(dune)
summary(Ordination.model2, scaling=1)

Run the code above in your browser using DataLab