Learn R Programming

vegan (version 1.4-3)

wascores: Weighted Averages Scores for Species

Description

Computes Weighted Averages scores of species for ordination configuration or for environmental variables.

Usage

wascores(x, w, expand=FALSE)

Arguments

x
Environmental variables or ordination scores.
w
Weights: species abundances.
expand
Expand weighted averages so that they have the same weighted variance as the corresponding environmental variables.

Value

  • Returns a matrix where species define rows and ordination axes or environmental variables define columns.

Details

Computes weighted averages. Weighted averages `shrink': they cannot be more extreme than values usd for calculating the averages. With expand = TRUE, the function `dehsrinks' the weighted averages by making their weighted variance equal to the weighted variance of the corresponding environmental variable.

See Also

isoMDS

Examples

Run this code
data(varespec)
data(varechem)
library(MASS)  ## isoMDS
library(mva)   ## cmdscale to start isoMDS
vare.dist <- vegdist(wisconsin(varespec))
vare.mds <- isoMDS(vare.dist)
vare.points <- postMDS(vare.mds$points, vare.dist)
vare.wa <- wascores(vare.points, varespec)
plot(scores(vare.points), pch="+", asp=1)
text(vare.wa, rownames(vare.wa), cex=0.8, col="blue")
## Omit rare species (frequency <= 4)
freq <- apply(varespec>0, 2, sum)
plot(scores(vare.points), pch="+", asp=1)
text(vare.wa[freq > 4,], rownames(vare.wa)[freq > 4],cex=0.8,col="blue")
## Works for environmental variables, too.
wascores(varechem, varespec)

Run the code above in your browser using DataLab