Dear friends,

    Here the solution for the question I posted some days ago about
obtaining factor loadings when running a PCA with vegan package in R.

    The Question:

> Hi all,
>
>    I am using the vegan package to run a prcincipal components
analysis
> on forest structural variables (tree  density, basal area, average
> height, regeneration density) in R.
>
>    However, I could not find out how to extract factor loadings
> (correlations of each variable with each pca axis), as is
straightforwar
> in princomp.
>
>    Do anyone know how to do that?


If ord is your fitted PCA ordination done using rda() from vegan, then
we just need to extract the *unscaled* species scores to get the same
things as is given by loadings() on a princomp ordination or the
$rotation from a prcomp ordination

require(vegan)
foo <- princomp(USArrests, cor = TRUE)
FOO <- prcomp(USArrests, scale = TRUE)
bar <- rda(USArrests, scale = TRUE)

loadings(foo)
with(FOO, rotation)
scores(bar, choices = 1:4, display = "species", scaling = 0)

      Alexandre


Dr. Alexandre F. Souza 
Programa de Pós-Graduação em Biologia: Diversidade e Manejo da Vida
Silvestre
Universidade do Vale do Rio dos Sinos (UNISINOS)
Av. UNISINOS 950 - C.P. 275, São Leopoldo 93022-000, RS  - Brasil
Telefone: (051)3590-8477 ramal 1263
Skype: alexfadigas
[email protected]
http://www.unisinos.br/laboratorios/lecopop

-- 
Esta mensagem foi verificada pelo sistema de antiv�rus e
 acredita-se estar livre de perigo.

Reply via email to