dimred.plot_pca: Function to plot components from PCA (Principal Component...

Description Usage Arguments Value Examples

Description

The function returns a pairs plot of a user defined number of components, that can also be colored by a label if available. Be aware that the function also centers and scales the data before computing the principal component analysis.

TODO: Figure out how to print a single legend with class labels Currently the legend is positioned for every plot in the grid.

The lower diagonal fo the pais plot shows the projected data points to the respective component space.

Usage

1
dimred.plot_pca(df, label = NULL, ncomp = 3)

Arguments

df

The principal component matrix variable by component (data.frame)

label

Vector by which the data points should be labeled (numeric, character or factor)

ncomp

The number of components theat should be plotted against each other (integer)

Value

A pairs plot (ggplot2) of principal components

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
data(fiveClass)
Y <- fiveClass$Class
X <- fiveClass[, 2:ncol(fiveClass)]

## Default Pairs Plot of the First 3 Principal Components
dimred.plot_pca(X)

dimred.plot_pca(X, Y)

## Varying the Number of Components
dimred.plot_pca(X, Y, ncomp=5)

## End(Not run)

jhooge/BioViz documentation built on May 19, 2019, 9:28 a.m.