A summary and different plots are given as a result of principal components analysis of an spectral counts matrix.
1  counts.pca(msnset, facs = NULL, do.plot = TRUE, snms = NULL, wait = TRUE)

msnset 
A MSnSet with spectral counts in the expression matrix. 
do.plot 
A logical indicating whether to plot the PCA PC1/PC2 map. 
facs 
NULL or a data frame with factors. See details below. 
snms 
Character vector with sample short names to be plotted. If NULL then 'Xnn' is plotted where 'nn' is the column number in the datset. 
wait 
This function may draw different plots, one by given factor in

The spectral counts matrix is decomposed by means of prcomp
.
If do.plot
is TRUE, a plot is generated for each factor showing the PC1/PC2 samples map, with samples colored as per factor level. If facs
is NULL
then the factors are taken from pData(msnset)
.
Invisibly returns a list with values:
pca 
The return value obtained from 
pc.vars 
The percentage of variability corresponding to each principal component. 
Josep Gregori
1 2 3 4 5  data(msms.dataset)
msnset < pp.msms.data(msms.dataset)
lst < counts.pca(msnset)
str(lst)
print(lst$pc.vars[,1:4])

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
Please suggest features or report bugs with the GitHub issue tracker.
All documentation is copyright its authors; we didn't write any of that.