[R] Can't reproduce clusplot princomp results.

Thomas M. Parris parris at isciences.com
Mon May 23 20:01:38 CEST 2005


Dear R folk:

Perhaps I'm just dense today, but I am having trouble reproducing the
principal components plotted and summarized by clusplot.  Here is a brief
example using the pluton dataset.  clusplot reports that the first two
principal components explain 99.7% of the variability.  But this is not what
princomp is reporting.  I would greatly appreciate any advice.

With best regards,
-- Tom

> R.version
         _              
platform i386-pc-mingw32
arch     i386           
os       mingw32        
system   i386, mingw32  
status                  
major    2              
minor    0.1            
year     2004           
month    11             
day      15             
language R         

> require("cluster")
[1] TRUE
> pluton.agnes <- agnes(pluton)
> clusters <- cutree(as.hclust(pluton.agnes), h=4.00)
> clusplot(pluton, clusters, lines=0)
> pca <- princomp(pluton, cor=TRUE)
> loadings(pca)

Loadings:
      Comp.1 Comp.2 Comp.3 Comp.4
Pu238  0.521  0.348  0.714  0.313
Pu239 -0.540                0.837
Pu240  0.418 -0.835         0.353
Pu241  0.512  0.418 -0.698  0.277

               Comp.1 Comp.2 Comp.3 Comp.4
SS loadings      1.00   1.00   1.00   1.00
Proportion Var   0.25   0.25   0.25   0.25
Cumulative Var   0.25   0.50   0.75   1.00




More information about the R-help mailing list