plotPCA {mrbin}R 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,
  xpd = NA
)

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?

xpd

Should labels be clipped to the plot region (TRUE) or exceed to margins (NA)

Value

An invisible prcomp result object

Examples

resetEnv()#clean up previous data from the package environment 
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",
    fixNegatives="No",logTrafo="No",PCA="No",signal_to_noise2D=10,
    example=TRUE,#only used for the package examples
    NMRfolders=c(system.file("extdata/1.mr2",package="mrbin"),
                 system.file("extdata/2.mr2",package="mrbin"),
                 system.file("extdata/3.mr2",package="mrbin")),
    NMRvendor="mrbin"))
plotPCA(results)

[Package mrbin version 1.9.4 Index]