[R] princomp - how to take out part result

Nash morrison at ibms.sinica.edu.tw
Sat Feb 7 15:07:28 CET 2009


Dear all, i have two problems
  
if i have a principal components analysis report as follows:

?princomp

problem one.

> pc.cr <- princomp(USArrests, cor = TRUE)
> pc.cr

i want to export a txt file (*.txt) to save "pc.cr" report
###########################################
Call:
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.
###########################################
what can i do ?

-----------------------------------------------------------
problem two.

> load  <- loadings(pc.cr)
> load

Loadings:
         Comp.1 Comp.2 Comp.3 Comp.4
Murder   -0.536  0.418 -0.341  0.649
Assault  -0.583  0.188 -0.268 -0.743
UrbanPop -0.278 -0.873 -0.378  0.134
Rape     -0.543 -0.167  0.818       

               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

i want to take out matrix

               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

what can i do ?

Can anyone help me ?

Nash 2009.02.07





--
Nash - morrison at ibms.sinica.edu.tw




More information about the R-help mailing list