pmfpca | R Documentation |

perform principle compponent analysis on ramclustR object dataset, export plots

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

`ramclustObj` |
ramclustR object to perform PCA on |

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

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

`subset` |
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. |

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

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

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

`npc` |
"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

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.