Description Usage Arguments Details Examples
View source: R/lipidome_comparison_pca.R
'biplot_factoextra' prints a biplot from a prcomp element.
1 2 3 4 5 6 7 | biplot_factoextra(
prcomp_element,
groups = "none",
ellipse = FALSE,
loadings = "none",
out_path = "none"
)
|
prcomp_element |
object of class prcomp. The base::prcomp function performs a principal component analysis. This is the object it returns. |
groups |
vector. Groups to color by. Default = "none" |
ellipse |
bool. Draw confidence ellipse arount the clusters of groups. Default = FALSE. |
loadings |
string / vector of strings. Draw loadings arrows and labels. c("arrow", "text"), "text", "none" (default). |
out_path |
string. Path to save plot to png. If out_path is empty, the plot is printed to the device. |
This function prints a biplot from a prcomp element. The points can be colored by group. Loadings are optionally displayed.
1 2 3 4 5 6 7 | {pca_iris <- prcomp(dplyr::select_if(iris, is.numeric))
iris_groups <- iris$Species
biplot_factoextra(pca_iris)
biplot_factoextra(pca_iris,
groups = iris_groups,
ellipse = TRUE,
loadings = c("arrow", "text"))}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.