scree_factoextra: Scree plot with factoextra

Description Usage Arguments Details Examples

View source: R/lipidome_comparison_pca.R

Description

'scree_factoextra' takes a prcomp element and diplays the percentage of variance explained by the principal components in a barplot.

Usage

1
scree_factoextra(prcomp_element, title = "Scree plot", out_path = "none")

Arguments

prcomp_element

object of class prcomp or pca. Produced by base::prcomp or FactoMineR::PCA.

title

string. Main title of plot. Default: "Scree plot"

out_path

string. Path to save plot to png. If out_path is empty, the plot is printed to the device.

Details

This function takes a prcom element (i.e. an element generated by the base::prcomp function), and displays the percentage of variance explained by each principal component in a barplot. Additionally there is also a dot- and line graph.

Examples

1
2
{pca_iris <- prcomp(dplyr::select_if(iris, is.numeric))
scree_factoextra(pca_iris, title = "Scree plot iris")}

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