plotPCA: A function for plotting PCA plots.

View source: R/mrbin.R

plotPCAR Documentation

A function for plotting PCA plots.

Description

This function performs PCA, then plots PC1 and PC2.

Usage

plotPCA(
  mrbinResults,
  defineGroups = TRUE,
  loadings = FALSE,
  legendPosition = "bottomleft",
  annotate = TRUE,
  verbose = TRUE
)

Arguments

mrbinResults

An mrbin object

defineGroups

Should groups be colored differently?

loadings

Should loadings be plotted instead of scores?

legendPosition

Where should the legend be plotted, Defaults to "left", other options include "top", "topright", etc.

annotate

Should loadings be annotated with metabolite identities, if available in $metadata?

verbose

Should a summary be displayed?

Value

An invisible prcomp result object

Examples

mrbinResults<-mrbin(silent=TRUE,setDefault=FALSE,parameters=list(dimension="2D",
    binRegion=c(8,1,15,140),binwidth2D=0.1,binheight=4,solventRegion=c(5.5,4.2),
    PQNScaling="No",noiseRemoval="Yes",trimZeros="Yes",tryParallel=TRUE,
    fixNegatives="No",logTrafo="No",PCA="No",signal_to_noise2D=10,
    NMRfolders=c(system.file("extdata/1/12/pdata/10",package="mrbin"),
                 system.file("extdata/2/12/pdata/10",package="mrbin"))))
plotPCA(mrbinResults)

mrbin documentation built on June 22, 2024, 9:39 a.m.