PcaPlots: PCA plots

Description Usage Arguments Author(s) See Also Examples

View source: R/PcaPlots.R

Description

Produces PCA plots of the metabolomics data.

Usage

1
2
3
4
5
6
7
PcaPlots(featuredata, groupdata, saveplot = FALSE,
  saveinteractiveplot = FALSE, plotname = "", savetype = c("png", "bmp",
  "jpeg", "tiff", "pdf"), interactiveonly = FALSE, interactiveplots = TRUE,
  y.axis = 1, x.axis = 2, center = TRUE, scale = TRUE,
  userinput = TRUE, returninteractive = FALSE, main = NULL,
  varplot = FALSE, multiplot = FALSE, n = 3, cols = NULL,
  cex_val = 0.7, ...)

Arguments

featuredata

featuredata A data frame in the featuredata format. This is a dataframe with metabolites in columns and samples in rows. Unique sample names should be provided as row names. See NormalizeMets Vignette for details.

groupdata

A data frame or a vector with group names.

saveplot

A logical indication whether to save the plot produced.

saveinteractiveplot

A logical indication whether to save the interactive plots produced.

plotname

Name of the output file if the file is to be saved. This is the general name for all the graphs and the specific type prefix will be added automatically.

savetype

The required format for the plot to be saved in. Threre is a choice of "png","bmp","jpeg","tiff","pdf" type files.

interactiveonly

Alogical indicating whether to show interactive plots only.

interactiveplots

A logical indication whether an interactive plot is to be shown.

y.axis

The principal component to be plotted on the y-axis.

x.axis

The principal component to be plotted on the x-axis.

center

A logical indicating whether the variables should be scaled to have zero mean.

scale

A logical indicating whether the variables should be scaled to have unit variance before the analysis takes place.

userinput

A logical indication whether user input should be required to show plots progressively. Should be FALSE when the plots are to be passed on to other functions or saved as variables for later use.

returninteractive

A logical indication whether a list of the interactive plots should be returned by the function

main

Plot title.

varplot

A logical indicating whether explained variance should be plotted.

multiplot

If TRUE, pairs plots of the first n principal components will be plotted.

n

The number of principal components to be plotted if multiplot=TRUE. The default value is set to 5.

cols

A character string with colours to be used.

cex_val

A numeric indicating the size of some text elements.

...

Arguments to be passed on to other methods.

Author(s)

Alysha M De Livera, Gavriel Olshansky

See Also

prcomp.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
    data(mixdata)
    
    # produce all results
    PcaPlots(mixdata$featuredata,mixdata$sampledata[,3],multiplot = TRUE, 
    varplot = TRUE, interactiveplots = TRUE)
    
    # return a list of the ineractive plots only
    interactive.pca <- PcaPlots(mixdata$featuredata,mixdata$sampledata[,3],
    interativeonly = TRUE, interactiveplots = TRUE,
    userinput = FALSE, returninteractive = TRUE)
    

NormalizeMets documentation built on May 1, 2019, 10:26 p.m.