[R] body of non-visible function

Anna Oganyan aoganyan at niss.org
Thu May 5 16:42:00 CEST 2005

Is there any possibility in R to see the body of the “non-visible” 
function, for
example “princomp”?
If I do :

 > methods(princomp)

so, I get that princomp.default and princomp.formula are non-visible 
functions and
body(princomp.default) doesn’t show it.

In particular, I guess I have a very naïve question…
I’d like to see how scores calculation is implemented in the function
princomp. Because when I multiply my data matrix on the matrix of loadings
 >data.matrix %*% princomp(data.matrix, scores=T)$loadings

I get different result than just doing

 >princomp(data.matrix, scores=T)$scores.


More information about the R-help mailing list