plotSample: Sample representation for Principal Component Analysis

Description Usage Arguments Value Author(s) See Also Examples

View source: R/pca.R

Description

Sample representation for Principal Component Analysis (PCA)

Usage

1
2
3
plotSample(acp, axes = c(1, 2), new.plot = FALSE, lab = "quality",
palette="rainbow", lim.cos2.sample = 0, text = TRUE,
lab.title = NULL, ellipse=FALSE, ...)

Arguments

acp

result from PCA or do.pca function

axes

axes for sample representation, by default 1 and 2

new.plot

if TRUE, a new graphical device is created, by default = FALSE

lab

character. Sample label, by default = quality (points are labelled by quality index). If lab=NULL, no label is displayed.

lim.cos2.sample

keep samples with cos2 >= lim.cos2.sample, by default = 0

palette

characters. Name of a palette, By default, "rainbow" palette

text

add sample name or not, by default = TRUE

lab.title

title for the legend, by default = NULL

ellipse

if TRUE and lab provided, draw 95$%$ confidence ellipse around barycentre of each group

...

Arguments to be passed to methods, such as graphical parameters (see 'par').

Value

Sample representation on axes axes[1] and axes[2] colored by quality index (= cos2 of samples) or colored by lab

Author(s)

Nicolas Servant, Eleonore Gravier, Pierre Gestraud, Cecile Laurent, Caroline Paccard, Anne Biton, Jonas Mandel, Bernard Asselain, Emmanuel Barillot, Philippe Hupe

See Also

runPCA,PCA

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data(marty)

## PCA on sample - example set
example.subset <- marty[1:100,]
pca <- runPCA(t(example.subset), verbose = FALSE, plotInertia = FALSE, plotSample = FALSE)

## Sample plot of PCA object colored by tumour type
perso.colors <- colorRampPalette(c("red", "green"))
## Not run: 
plotSample(pca, lab = marty.type.cl, palette="perso.colors", ellipse=TRUE)

## End(Not run)

EMA documentation built on March 26, 2020, 8:40 p.m.