pmfpca: pmfpca

View source: R/pmf-pca.R

pmfpcaR Documentation



perform principle compponent analysis on ramclustR object dataset, export plots


  ramclustObj = RC, = "SpecAbund",
  scale = "pareto", = NULL,
  subset = c(),
  subset.cmpd = c(),
  which.factors = NULL,
  num.factors = NULL, = "cmpd",
  npc = "auto",
  bw = FALSE,
  ag.summary.plot = FALSE



ramclustR object to perform PCA on

character; which dataset (SpecAbund or SpecAbundAve) to perform PCA on.


character; default = 'pareto'. will also accept 'uv' or 'none'

character: directory name for output.


character or integer vector; if character, must be even length. If you wish to perform PCA only when your factor called 'treatment' is a 'trt' sample and when 'time' is '3', then you would use i.e. c("treatment", "trt", "time", "3"). vector length must always be even, and with 'factor' followed by 'level'. If an integer vector is provided, only row numbers matching those integers are retained.


character vector; i.e. which.factors = c("treatment", "time"). which factors should be used for coloring PCA plots?


which factors should be treated as numeric? must be subset of 'which.factors'. i.e. c("time")

how should metabolites columns be labelled? one of 'ann' or 'cmpd', typically.


"auto" by default (recommended). This will autoselect number of PCs to use. Can also be set to any integer value to force more PCs.


This function uses the native prcomp() function in R to perform PCA analysis.

Automatic selection of the number of principle components using the AuerGervini method is enabled by the PCDimension and ClassDiscovery packages.

R PCA AuerGervini objects are attached to the ramclustR object, and summary plots and csv files are written to the stats/pca directory in the working directory

a methods narrative is also appended to the $history slot


returns a ramclustR object. new R object in $pca slot. Optionally, new R object in $AuerGervini slot if npc = "auto".


Corey Broeckling

cbroeckl/ documentation built on May 26, 2024, 4:53 p.m.