Description Usage Arguments Value Examples
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.
"Lower Diagonal"The lower diagonal shows the data points projected to the respective two dimensional component space.
"Upper Diagonal"The upper diagonal shows a contour plot of the data projected the respective two dimensional component space.
"Diagonal"The diagonal shows a density plot of the projection of variables to a principal component axis.
The lower diagonal fo the pais plot shows the projected data points to the respective component space.
1 | dimred.plot_pca(df, label = NULL, ncomp = 3)
|
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) |
A pairs plot (ggplot2) of principal components
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.