pca_scoresplot2D: 2D PCA scores plot

Description Usage Arguments Examples

View source: R/pca.R

Description

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

Usage

1
2
3
pca_scoresplot2D(dataset, pca.result, column.class, 
pcas = c(1, 2), labels = FALSE, ellipses = FALSE, bw=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. Ellipses will not be drawn if bw=TRUE.

bw

if TRUE, it will be displayed a black and white plot. It defaults to FALSE.

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

1
2
3
4
5
6
  ## Example of a 2D PCA scores plot
  library(specmine.datasets)
  data(cachexia)
  pca.result = pca_analysis_dataset(cachexia)
  pca_scoresplot2D(cachexia, pca.result, "Muscle.loss", pcas = c(1,2), 
    		   ellipses = TRUE)

specmine documentation built on Sept. 21, 2021, 5:06 p.m.