Learn R Programming

mrbin (version 1.9.1)

plotPCA: 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
)

Value

An invisible prcomp result object

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?

Examples

Run this code
results<-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"),
                 system.file("extdata/3/12/pdata/10",package="mrbin"))))
plotPCA(results)

Run the code above in your browser using DataLab