biplot_factoextra: Biplot with factorextra

Description Usage Arguments Details Examples

View source: R/lipidome_comparison_pca.R

Description

'biplot_factoextra' prints a biplot from a prcomp element.

Usage

1
2
3
4
5
6
7
biplot_factoextra(
  prcomp_element,
  groups = "none",
  ellipse = FALSE,
  loadings = "none",
  out_path = "none"
)

Arguments

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.

Details

This function prints a biplot from a prcomp element. The points can be colored by group. Loadings are optionally displayed.

Examples

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"))}

lisaschneider0509/lipidomeComparisonR documentation built on Aug. 12, 2020, 12:52 a.m.