[R-sig-eco] pearson correlation with axes of NMDS or capscale

Jari Oksanen jari.oksanen at oulu.fi
Wed Aug 18 10:14:16 CEST 2010


On Wed, 2010-08-18 at 09:50 +0200, Opdekamp Wout wrote:
> Hi all,
> 
> In Primer/permanova+ it is possible to get the pearson correlation of a
> species with the axes of NMDS or capscale. Is it possible to extract or
> calculate these as well based on the output from metaMDS() or capscale
> (), both from the vegan-package?

Wout,

Short answer: Yes.

A bit longer answer: you shouldn't do this for metaMDS (or NMDS in
general) since there the orientation of axes is random and axes do not
have a special meaning.

A longer answer or how to do this. You may paste the following to an R
window (explanations are commented):

### BEGIN R
## NMDS
library(vegan)
data(dune)
m <- metaMDS(dune)
cor(dune, scores(m, dis="si"))
## capscale, copying the previous method, but 4 axes
m <- capscale(dune ~ 1)
cor(dune, scores(m, dis="si", choices=1:4)
## capscale, the direct way re-using the previous result
scores(m, dis="sp", scaling=-2, const = sqrt(nrow(dune)-1)))
### END

That is, with appropriate scaling, capscale scores are the correlations
between species and axes.

Cheers, Jari Oksanen



More information about the R-sig-ecology mailing list