Skip to contents

Returns a bar plot of the percentage of variance explained by each Principal Component calculated by pcaBySvd.

Usage

pcaScreePlot(
  resPcaBySvd,
  nPC = 5,
  title = "PCA scree plot",
  theme = theme_bw()
)

Arguments

resPcaBySvd

A list corresponding to the output value of pcaBySvd.

nPC

An integer with the number of Principal Components to plot.

title

Plot title.

theme

ggplot2 theme, see ?ggtheme for more info.

Value

A ggplot2 PCA scree plot

Examples


data("UCH")
resPCA <- pcaBySvd(UCH$outcomes)
pcaScreePlot(resPCA, nPC = 4)