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

add.spec.scoresR Documentation

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, postMDS, metaMDS or NMSrandom.

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 average scores (via function wascores) and method "pcoa.scores" calculates the scores by weighing the correlation between site scores and species vectors by variance explained by the ordination axes.

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.

Author(s)

Roeland Kindt

References

Kindt, R. & Coe, R. (2005) Tree diversity analysis: A manual and software for common statistical methods for ecological and biodiversity studies.

https://www.worldagroforestry.org/output/tree-diversity-analysis

Examples

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)
# Change scores for second axis
Ordination.model1$points[,2] <- -1.0 * Ordination.model1$points[,2]
Ordination.model1 <- add.spec.scores(Ordination.model1, dune, 
    method='pcoa.scores', Rscale=TRUE, scaling=1, multi=1)
# Compare Ordination.model1 with PCA
Ordination.model2 <- rda(dune, scale=FALSE)
#
par(mfrow=c(1,2))
ordiplot(Ordination.model1, type="text")
abline(h = 0, lty = 3)
abline(v = 0, lty = 3)
plot(Ordination.model2, type="text", scaling=1)

BiodiversityR documentation built on June 22, 2024, 11:57 a.m.