Learn R Programming

specmine (version 1.0)

pca_scoresplot2D: 2D PCA scores plot

Description

Shows a 2D PCA scores plot of two principal componets.

Usage

pca_scoresplot2D(dataset, pca.result, column.class, pcas = c(1, 2), labels = FALSE, ellipses = FALSE, pallette = 2, leg.pos = "right", xlim = NULL, ylim = NULL)

Arguments

dataset
list representing the dataset from a metabolomics experiment.
pca.result
prcomp object with the PCA results.
column.class
metadata's variable.
pcas
vector of two elements with the PCs that will be plotted.
labels
boolean value indicating if the sample's labels will be displayed.
ellipses
boolean value that indicates if an ellipse will be drawn on each group of the metadata's variable.
pallette
parameter of scale_colour_brewer from ggplot2.
leg.pos
position of the legend.
xlim
vector with two numeric values indicating the limits of the x axis.
ylim
vector with two numeric values indicating the limits of the y axis.

Examples

Run this code
  ## Example of a 2D PCA scores plot
  data(cachexia)
  pca.result = pca_analysis_dataset(cachexia)
  pca_scoresplot2D(cachexia, pca.result, "Muscle.loss", pcas = c(1,2), 
    		   ellipses = TRUE)

Run the code above in your browser using DataLab