mixOmics (version 4.1-4)

plotIndiv: Plot of Individuals (Experimental Units)

Description

This function provides scatter plots for individuals (experimental units) representation in (r)CCA, (s)PLS regression and PCA.

Usage

## S3 method for class 'rcc':
plotIndiv(object, comp = 1:2, ind.names = TRUE,
          rep.space = "XY-variate",
          x.label = NULL, y.label = NULL,
          col = "black", cex = 1, pch = 1, \ldots)
	  
## S3 method for class 'pls':
plotIndiv(object, comp = 1:2, ind.names = TRUE,
          rep.space = "X-variate",
          x.label = NULL, y.label = NULL,  
          col = "black", cex = 1, pch = 1, \ldots)	

## S3 method for class 'spls':
plotIndiv(object, comp = 1:2, ind.names = TRUE,
          rep.space = "X-variate",
          x.label = NULL, y.label = NULL,  
          col = "black", cex = 1, pch = 1, \ldots)

## S3 method for class 'pca':
plotIndiv(object, comp = 1:2, ind.names = TRUE,
          x.label = NULL, y.label = NULL, \ldots)

## S3 method for class 'spca':
plotIndiv(object, comp = 1:2, ind.names = TRUE,
          x.label = NULL, y.label = NULL, \ldots)

Arguments

object
object of class inheriting from "rcc", "pls", "plsda", "spls", "plsda", "pca" or "spca".
comp
integer vector of length two. The components that will be used on the horizontal and the vertical axis respectively to project the individuals.
ind.names
either a character vector of names for the individuals to be plotted, or FALSE for no names. If TRUE, the row names of the first (or second) data matrix is used as names (see Details).
rep.space
character string, (partially) matching one of "X-variate", "Y-variate" or "XY-variate", determining the subspace to project the individuals. Defaults to "XY-variate" and "X-variate"
x.label, y.label
$x$- and $y$-axis titles.
col
character (or symbol) color to be used, possibly vector.
cex
numeric character (or symbol) expansion, possibly vector.
pch
plot character. A character string or a vector of single characters or integers. See points for all alternatives.
...
further graphical parameters are passed to text.

encoding

latin1

Details

plotIndiv method makes scatter plot for individuals representation depending on the subspace of projection. Each point corresponds to an individual. If ind.names=TRUE and row names is NULL, then ind.names=1:n, where n is the number of individuals. The arguments col, cex and pch can be atomic vectors or vectors of length n. If atomic, this argument value determines the graphical attribute for all the individuals. In the last case, multiple arguments values can be specified so that each point (individual) can be given its own graphic attributes (see par). Default values exist for this arguments.

See Also

plot3dIndiv, text, points and http://www.math.univ-toulouse.fr/~biostat/mixOmics/ for more details.

Examples

Run this code
## plot of individuals for objects of class 'rcc' 
data(nutrimouse)
X <- nutrimouse$lipid
Y <- nutrimouse$gene
nutri.res <- rcc(X, Y, ncomp = 3, lambda1 = 0.064, lambda2 = 0.008)

plotIndiv(nutri.res) #(default) 

col <- rep(c("blue", "red"), c(20, 20))
plotIndiv(nutri.res, ind.names = nutrimouse$diet, col = col)
legend(-2.2, -1.1, c("WT", "PPAR"), pch = c(16, 16), 
       col = c("blue", "red"), text.col = c("blue", "red"),
       cex = 1, pt.cex = c(1.2, 1.2))

## plot of individuals for objects of class 'pls' or 'spls'	   
data(liver.toxicity)
X <- liver.toxicity$gene
Y <- liver.toxicity$clinic
toxicity.spls <- spls(X, Y, ncomp = 3, keepX = c(50, 50, 50), 
                      keepY = c(10, 10, 10))
		  
col <- rep(c("blue", "red", "darkgreen", "darkviolet"), rep(16, 4))
cex <- rep(c(1, 1.2, 1, 1.4), c(16, 16, 16, 16))
pch <- rep(c(15, 16, 17, 18), c(16, 16, 16, 16))
plotIndiv(toxicity.spls, comp = 1:2, ind.names = FALSE,
          rep.space = "X-variate", col = col, cex = cex, pch = pch)
legend("topright", c("50 mg/kg", "150 mg/kg", "1500 mg/kg", "2000 mg/kg"), 
       col = c("blue", "red", "darkgreen", "darkviolet"), 
       pch = c(15, 16, 17, 18), pt.cex = c(1, 1.2, 1, 1.4), 
       title = "Treatment")

Run the code above in your browser using DataLab