add.spec.scores {BiodiversityR} | R Documentation |
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).
add.spec.scores(ordi,comm,method="cor.scores",multi=1,Rscale=F,scaling="2")
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 . |
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.
Roeland Kindt
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/treesandmarkets/tree_diversity_analysis.asp
library(vegan) data(dune) distmatrix <- vegdist(dune) Ordination.model1 <- cmdscale(distmatrix, k=2, 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)