Skip to contents

met.plot_PCAScree visualizes the proportion of variance explained for each principal component.

Usage

met.plot_PCAScree(
  mSetObj = NA,
  imgName = "PCA_ScreePlot",
  format = "pdf",
  dpi = NULL,
  width = NA,
  scree.num,
  plot = TRUE,
  export = FALSE
)

Arguments

mSetObj

Input name of the created mSet object. Data container after principal component analysis (met.PCA.Anal).

imgName

(Character) Enter a name for the image file (if export = TRUE).

format

(Character, "png" or "pdf") image file format (if export = TRUE).

dpi

(Numeric) resolution of the image file (if export = TRUE). If NULL, the resolution will be chosen automatically based on the chosen file format (300 dpi for PNG, 72 dpi for PDF)

width

(Numeric) width of the the image file in inches (if export = TRUE).

scree.num

Numeric, input a number to indicate the number of principal components to display in the scree plot.

plot

(Logical, TRUE or FALSE) Shall the plot be returned in the RStudio 'Plots' pane?

export

(Logical, TRUE or FALSE) Shall the plot be exported as PDF or PNG file?

Value

The input mSet object with added line plot. The plot can be retrieved from within R via print(mSetObj$imgSet$pca.scree.plot).

Author

Nicolas T. Wirth mail.nicowirth@gmail.com Technical University of Denmark License: GNU GPL (>= 2)