pca_plot | R Documentation |
Plots two components of a PCA computed with do_pca
pca_plot( fit, group = NULL, sample_colors = NULL, cp1 = 1, cp2 = 2, legend = TRUE, legend_xy = "bottomleft", cex = 2, pch = 20, mgp = c(3, 1, 0), main = "PCA plot", save_png = NULL )
fit |
princomp object as returned by |
group |
Vector with the group to which each sample belongs.
The samples must be ordered as in |
sample_colors |
Named character vector of colors. The names of
the colors must be the classes in |
cp1 |
Integer, number of the component in the X-axis. Default is 1, the first component. |
cp2 |
Integer, number of the component in the Y-axis. Default is 2, the second component. |
legend |
Boolean, whether to plot a legend in the plot. Default is TRUE. |
legend_xy |
Situation of the legend in the plot. Available options are: "bottomright", "bottom", "bottomleft", "left", "topleft", "top", "topright", "right" and "center". |
cex |
Graphical parameter from |
pch |
Graphical parameter from |
mgp |
Graphical parameter from |
main |
Title of the graphics |
save_png |
Path to the file where the image as PNG will be saved. By default, the image is not saved. |
Plots two components of a PCA
data(path_vals) sample_group <- brca_design[colnames(path_vals),"group"] pca_model <- do_pca(path_vals[seq_len(ncol(path_vals)),]) pca_plot(pca_model, sample_group)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.