plotPCA: PCA score plot

View source: R/plotPCA.R

plotPCAR Documentation

PCA score plot

Description

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.

Usage

plotPCA(pca, PC1 = 1, PC2 = 2, file, colVar, symbVar, main = "")

Arguments

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

Value

A PCA score plot. Exported as png if 'file' specified in function call.

Examples

data("freelive2")
pca_object<-prcomp(XRVIP2)
plotPCA(pca_object)

MUVR2 documentation built on Sept. 16, 2024, 9:06 a.m.