[R-sig-eco] pca in ade4

Stéphane Dray stephane.dray at univ-lyon1.fr
Fri Nov 22 21:22:18 CET 2013


Hi,

I am not sure to understand what you really want to do. Here is an 
example of pca:

library(ade4)
data(doubs)
pca1 <- dudi.pca(doubs$env, scan = F)
screeplot(pca1)
summary(pca1)
scatter(pca1) ## or biplot(pca1)
s.label(pca1$li) ## factorial maps for the row
s.corcircle(pca1$co)

## partition of the sites in 3 groups according to their position on the 
river
fac <- cut(1:30, 3,labels=c("upstream", "center", "downstream"))
s.class(pca1$li, fac, col = rainbow(3))

Cheers


Le 22/11/2013 10:39, Mahnaz Rabbaniha a écrit :
> Dear all
>
> for pca on my data i used this code
>
> deug.dudi <- dudi.pca(c(1:62), center =c(63),scale = FALSE, scan = FALSE)
>
> s.class(deug.dudi$li, c(63), cpoint = 1)
>
> but i take this message:
>
> *Error in s.class(deug.dudi$li, c(63), cpoint = 1) : *
> *  factor expected for fac*
>
> please explain, what is meaning of this error
>
>
> thanks


-- 
Stéphane DRAY (stephane.dray at univ-lyon1.fr)
Laboratoire BBE-CNRS-UMR-5558, Univ. C. Bernard - Lyon I
43, Bd du 11 Novembre 1918, 69622 Villeurbanne Cedex, France
Tel: 33 4 72 43 27 57       Fax: 33 4 72 43 13 88
http://pbil.univ-lyon1.fr/members/dray/



More information about the R-sig-ecology mailing list