plotPCA | R Documentation |
Customised PCA score plots with the possibility to choose PCs, exporting to png and the possibility to add color or different plotting symbols according to variable.
plotPCA(pca, PC1 = 1, PC2 = 2, file, colVar, symbVar, main = "")
pca |
A 'prcomp' object |
PC1 |
Principal component on x-axis |
PC2 |
Principal component on y-axis |
file |
If specified provides the name of a png export file. Otherwise normal plot. |
colVar |
Continuous variable for coloring observations (40 cuts) |
symbVar |
Categorical/discrete variable for multiple plot symbols |
main |
If provided provides a main title of the plot |
A PCA score plot. Exported as png if 'file' specified in function call.
data("freelive2")
pca_object<-prcomp(XRVIP2)
plotPCA(pca_object)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.