add.spec.scores {BiodiversityR} | R 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 |
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 |
multi |
Multiplier for the species scores. |
Rscale |
Use the same scaling method used by vegan for |
scaling |
Scaling method as used by |
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)