Description Usage Arguments Value Examples
inputs:
1 2 3 4 5 | plot_pca(x, npcs = c(1, 2), xlab = NULL, ylab = NULL, zlab = NULL,
main = "PCA results", pch = NULL, col = NULL, bg = NULL, cex = NULL,
pal = RColorBrewer::brewer.pal(8, "Dark2"), add.legend = FALSE,
legend.position = "bottomleft", legend.text = NULL, legend.col = NULL,
legend.bg = NULL, legend.inset = 0, ...)
|
x: |
data frame, matrix or prcomp object to plot. |
npcs: |
numeric vector indicating PCs to plot, defaults to c(1,2). If length(npcs)>3, only the first 3 elements will be used. |
xlab: |
xlabel, see par. |
ylab: |
ylabel, see par, see par. |
zlab: |
zlabel, see plot3d. |
main: |
title for the plot, see par. Defaults to 'PCA results'. |
pch: |
numeric vector of plotting characters, see par. |
col: |
vector of plotting character colors, see par. |
bg: |
vector of plotting character background colors, see par. |
cex: |
plotting character size. Defaults to 1 for 2D and to 7 for 3D plots. |
pal: |
color palette. Defaults to the colorblind friendly RColorBrewer::brewer.pal(8,"Dark2"). Setting pal to NULL, will lead to the default R colors being used in the plots. |
add.legend: |
add a legend to the plot, defaults to FALSE. |
legend.position: |
, argument to legend. Position of the legend in the plot, defaults to 'bottomleft'. |
legend.text: |
character vector to appear in the legend. |
legend.col: |
color of legend elements, defaults to unique(col) |
legend.bg: |
background color of legend elements, defaults to unique(bg) |
legend.inset: |
inset distance(s) from the margins as a fraction of the plot region when legend is placed by keyword |
...: |
arguments passed to the plot() or rgl::plot3d() functions |
a list with class "prcomp", containing the same elements as prcomp:
var_explained: numeric vector indicating the varince explained by each PC
1 2 3 4 5 6 7 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.