Skip to contents

Produces score plots from pcaBySvd output with the same graphical options as plotScatter as this is a wrapper of this function..

Usage

pcaScorePlot(
  resPcaBySvd,
  design = NULL,
  axes = c(1, 2),
  title = "PCA score plot",
  points_labs_rn = FALSE,
  ...
)

Arguments

resPcaBySvd

A list corresponding to the output value of pcaBySvd.

design

A \(n \times k\) "freely encoded" experimental design data.frame.

axes

A numerical vector of length 2 with the Principal Components axes to be drawn.

title

Plot title.

points_labs_rn

Boolean indicating if the rownames of the scores matrix should be plotted.

...

Additional arguments to be passed to plotScatter.

Value

A ggplot2 PCA score plot.

Details

pcaScorePlot is a wrapper of plotScatter. See ?plotScatter for more information on the additional arguments.

Examples


data("UCH")

# design is explicitly defined
ResPCA <- pcaBySvd(Y = UCH$outcomes)

pcaScorePlot(
  resPcaBySvd = ResPCA, axes = c(1, 2),
  title = "PCA score plot UCH", design = UCH$design,
  color = "Hippurate", shape = "Citrate"
)


# design is recovered from lmpDataList through pcaBySvd()
ResPCA <- pcaBySvd(lmpDataList = UCH)

pcaScorePlot(
  resPcaBySvd = ResPCA, axes = c(1, 2),
  title = "PCA score plot UCH",
  color = "Hippurate", shape = "Citrate"
)