Skip to content

Plot a screeplot with the variance bars colored according to the AUC of the corresponding classes in a specified training response vector.

Usage

screeplot_auc(
  data.prcomp,
  auc.classes,
  auc.proj = NULL,
  main = NULL,
  nPCs = 20L,
  ...
)

Arguments

data.prcomp

A prcomp class object. Typically the object returned by prcomp2().

auc.classes

A vector of the training classes used in calculating the AUC.

auc.proj

An alternative projection matrix from another decomposition. By default, the projection from data.prcomp is used.

main

character(1). A string containing the title for the plot.

nPCs

integer(1). Number of PCs to plot.

...

Additional arguments passed to geom_col().

Author

Stu Field, Michael R. Mehan

Examples

pca <- center_scale(pcapkg:::log10_ft(simdata), center = TRUE, scale = FALSE) |>
  feature_matrix() |>
  prcomp2()
screeplot_auc(pca, simdata$class_response, main = "My ScreePlot by AUC")