pca_plot | R Documentation |
This function uses a group, PCA variables, and a scaled boolean to generate a biplot.using 'ggplot2' and 'scico'.
pca_plot(group, pcavars, scaled = FALSE, palette = "oslo")
group |
The group variable (column) |
pcavars |
The variables to include in the principle component analysis |
scaled |
A boolean (TRUE or FALSE) indicating if the pcavars are already scaled |
palette |
A color palette to use on the plot, with each group assigned to a color. |
A plot showing PC1 on the x axis, PC2 on the y axis, colored by group, with vectors and labels showing the individual pca variables.
pca_plot(iris$Species, iris[,c(1:4)])
pca_plot(iris$Species, iris[,c(1:4)], FALSE, "bilbao")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.