Skip to contents

Plot linear discriminant analysis results of pre-treated data

Usage

plotLDA(
  analysis,
  cls = "class",
  label = NULL,
  scale = TRUE,
  center = TRUE,
  xAxis = "DF1",
  yAxis = "DF2",
  shape = FALSE,
  ellipses = TRUE,
  title = "PC-LDA",
  legendPosition = "bottom",
  labelSize = 2,
  ...
)

# S4 method for AnalysisData
plotLDA(
  analysis,
  cls = "class",
  label = NULL,
  scale = TRUE,
  center = TRUE,
  xAxis = "DF1",
  yAxis = "DF2",
  shape = FALSE,
  ellipses = TRUE,
  title = "PC-LDA",
  legendPosition = "bottom",
  labelSize = 2
)

# S4 method for Analysis
plotLDA(
  analysis,
  cls = "class",
  label = NULL,
  scale = TRUE,
  center = TRUE,
  xAxis = "DF1",
  yAxis = "DF2",
  shape = FALSE,
  ellipses = TRUE,
  title = "PC-LDA",
  legendPosition = "bottom",
  labelSize = 2,
  type = c("pre-treated", "raw")
)

Arguments

analysis

S4 object of class AnalysisData or Analysis

cls

name of sample information column to use for class labels

label

name of sample information column to use for sample labels. Set to NULL for no labels.

scale

scale the data

center

center the data

xAxis

principle component to plot on the x-axis

yAxis

principle component to plot on the y-axis

shape

TRUE/FALSE use shape aesthetic for plot points. Defaults to TRUE when the number of classes is greater than 12

ellipses

TRUE/FALSE, plot multivariate normal distribution 95\ confidence ellipses for each class

title

plot title

legendPosition

legend position to pass to legend.position argument of ggplot2::theme. Set to "none" to remove legend.

labelSize

label size. Ignored if label is NULL

...

arguments to pass to the appropriate method

type

raw or pre-treated data to plot

Examples

library(metaboData)

d <- analysisData(abr1$neg,abr1$fact) %>% 
 occupancyMaximum(cls = 'day')

## LDA plot
plotLDA(d,cls = 'day')