pcaLoading2dPlot: Loading plots on a 2D scatter plot

View source: R/pcaLoading2dPlot.R

pcaLoading2dPlotR Documentation

Loading plots on a 2D scatter plot

Description

Produces loading plots from pcaBySvd with the same graphical options as plotScatter.

Usage

pcaLoading2dPlot(
  resPcaBySvd,
  axes = c(1, 2),
  title = "PCA loading plot",
  points_labs_rn = FALSE,
  metadata = NULL,
  ...
)

Arguments

resPcaBySvd

A list corresponding to the output value of pcaBySvd.

axes

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

title

Plot title.

points_labs_rn

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

metadata

A nxk "free encoded" data.frame corresponding to design in plotScatter.

...

Additional arguments to be passed to plotScatter.

Details

pcaLoading2dPlot is a wrapper of plotScatter.

Value

A ggplot object with the PCA loading plot.

Examples


data('UCH')
ResPCA = pcaBySvd(UCH$outcomes)

# adding (arbitrary) color and shape to points
groups <- rep(c(1,2), length.out = ncol(UCH$outcomes))
metadata <- data.frame(groups)

pcaLoading2dPlot(resPcaBySvd = ResPCA, axes = c(1,2),
title = "PCA loading plot UCH", metadata = metadata,
color = "groups", shape = "groups")


bgovaerts/LMWiRe documentation built on Sept. 17, 2022, 12:32 a.m.