[R] princomp

Jesús María Frías Celayeta iosu at ensia.inra.fr
Tue Sep 21 10:44:31 CEST 1999


> I downloaded R-base-0.64.1-1 for Linux and for Windows and in both I cannot find princomp.
> When I type library(help=mva), princomp is not listed.

	Well, princomp is not listed in the library index, but it is
installed and you can use it. That happened  in 0.64.1 and it keeps on

	In fact if you do,

> library(mva)
> library(help=mva)
cancor                   Canonical Correlations
cmdscale                 Classical (Metric) Multidimensional Scaling
dist                     Distance Matrix Computation
hclust                   Hierarchical Clustering
kmeans                   K-Means Clustering
prcomp                   Principal Components Analysis

princomp is not listed, but if you call the princomp help page

> help(princomp)

   Principal Components Analysis

        princomp(x, cor = FALSE, scores = TRUE,
                 subset = rep(TRUE, nrow(as.matrix(x))))

        print(obj,...)  summary(obj)  plot(obj,...)  predict(obj,...)



or you can work out the example

>         data(USArrests)
>         (pc.cr <- princomp(USArrests))
princomp(x = USArrests)

Standard deviations:
   Comp.1    Comp.2    Comp.3    Comp.4 
82.890847 14.069560  6.424204  2.457837 

 4  variables and  50 observations.
>         princomp(USArrests, cor = TRUE)
princomp(x = USArrests, cor = TRUE)

Standard deviations:
   Comp.1    Comp.2    Comp.3    Comp.4 
1.5748783 0.9948694 0.5971291 0.4164494 

 4  variables and  50 observations.
>         princomp(scale(USArrests, scale = TRUE, center = TRUE), cor =
princomp(x = scale(USArrests, scale = TRUE, center = TRUE), cor = FALSE)

Standard deviations:
   Comp.1    Comp.2    Comp.3    Comp.4 
1.5590500 0.9848705 0.5911277 0.4122639 

 4  variables and  50 observations.

	This is a minor thing that i discovered sometime ago working with
the mva library, but 

> Where can I find it ?
> Moritz

Jesús María Frías Celayeta		"Valeu a pena? Tudo vale a pena
ENSIA-INRA, Av. des Olimpiades, 1	se a alma não é pequena
91744, Massy. FRANCE			Quem quer passar além do Bojador
Fax:intl+33+1+69935185			Tem que passar além da dor.
Phone:intl+33+1+69935191		Deus ao mar o perigo e abismo deu,
					Mas nele é que espelhou o céu"

r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list