Description Usage Arguments Value See Also
A group of functions for PCA plots.
pca: PCA plot with one or two group info.
pca_multi: Multiple PCA plots for top PCs.
pca_bg: PCA plot with color background shading for each subtype
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | pca(
df,
A,
B = NULL,
title = "PCA",
col = colpal,
nameA = "subtypeA",
nameB = "subtypeB",
point.size = 4,
shapes = c(16:18, 15),
plot.it = TRUE,
return.data = FALSE
)
pca_multi(
df,
subtype = NULL,
n = 6,
col = colpal,
title = NULL,
plot.it = TRUE
)
pca_bg(
df,
subtype,
col = colpal,
legend.name = NULL,
point.size = 6,
text.size = 26,
mar = 15,
plot.it = TRUE
)
|
df |
numeric dataframe with rows of samples and columns of features |
A, B, subtype |
character vector of the subtypes of samples |
col |
color to be used for each subtype. |
plot.it |
if FALSE, no plot printed, only return the plot object |
n |
for pca_multi, number of PCs to be plotted |
mar |
for pca_bg, margin between the points to the frame. |
"+" |
use + to add ggplot layers for more customization |
Print the plot and return the plot
pca: a ggplot object
pca_multi: a plot object
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.