The R Stats Package function prcomp is used to perform a principal components analysis on the given data matrix. It returns the results as an object of class ```prcomp```.
The calculation is done by a singular value decomposition of the (centered and possibly scaled) data matrix, not by using eigen on the covariance matrix. This is generally the preferred method for numerical accuracy. The print method for these objects prints the results in a nice format and the plot method produces a scree plot.
Vignette: link
source code: link