DrawLoadings: Loadings plots

Description Usage Arguments Details Value Examples

View source: R/DrawLoadings.R

Description

Draws Loadings plots for the SVDforPCA, PLSDA or OPLSDA functions.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
DrawLoadings(
  obj,
  type.obj = c("PCA", "PLSDA", "OPLSDA"),
  createWindow = FALSE,
  main = NULL,
  axes = c(1, 2),
  loadingstype = c("l", "p", "s"),
  num.stacked = 4,
  xlab = NULL,
  ylab = NULL,
  ang = c("0", "45", "90"),
  xaxis_type = c("numerical", "character"),
  nxaxis = 10,
  hline = NULL,
  xaxis_size = 11
)

Arguments

obj

The objects resulting from a PCA, PLSDA or OPLSDA analysis.

type.obj

The type of object to be plotted.

createWindow

If TRUE, will create a new window for the plot.

main

Plot title. If NULL, default title is provided.

axes

Numerical vector indicating the PC axes that are drawn.

loadingstype

The type of Loadings plot, either a line plot ('l'), points ('p') or segments ('s').

num.stacked

Number of stacked plots.

xlab

Label for the x-axis.

ylab

Label for the y-axis.

ang

Angle to rotate the x axis labels for a better visualisation, either 0, 45 or 90 degrees.

xaxis_type

Specify if the xaxis is numerical or character

nxaxis

Number of thick marks on the xaxis for a character x variable

hline

Numerical scalar. If not NULL, an horizontal dashed line is drawn at the hline value

xaxis_size

Size of the x axis.

Details

Better results printping is obtained by saving the plot as an object

Value

A loading plot in the current device.

Examples

1
2
3
4
5
6
data('HumanSerum')
res.PCA = SVDforPCA(HumanSerumSpectra)

DrawLoadings(res.PCA, type.obj = 'PCA',
createWindow = FALSE, main = 'PCA loadings plot for HumanSerum dataset',
   axes = 1,  loadingstype='l', xlab = "L1")

ManonMartin/MBXUCL documentation built on Nov. 26, 2021, 8:45 p.m.