plotIndiv {integrOmics} | R Documentation |
This function provides scatter plots for individuals (experimental units) representation in (r)CCA and (s)PLS regression.
## S3 method for class 'rcc': plotIndiv(object, comp1 = 1, comp2 = 2, ind.names = TRUE, rep.space = c("X-variate", "Y-variate", "XY-variate"), x.label = NULL, y.label = NULL, col = "black", cex = 1, pch = 1, ...) ## S3 method for class 'pls': plotIndiv(object, comp1 = 1, comp2 = 2, ind.names = TRUE, rep.space = c("X-variate", "Y-variate", "XY-variate"), x.label = NULL, y.label = NULL, col = "black", cex = 1, pch = 1, ...) ## S3 method for class 'spls': plotIndiv(object, comp1 = 1, comp2 = 2, ind.names = TRUE, rep.space = c("X-variate", "Y-variate", "XY-variate"), x.label = NULL, y.label = NULL, col = "black", cex = 1, pch = 1, ...)
object |
object of class inheriting from "rcc" , "pls" or "spls" . |
comp1, comp2 |
an integer, the component 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. De-fa-ults to "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 . |
plotIndiv
method makes scatter plot for individuals representation
depending on the variate components selected and the subspace of projection.
Each point corresponds to an individual.
If rep.space="XY-variate"
, component comp1
and comp2
correspond to
X- and Y-variates respectively.
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.
Sébastien Déjean and Ignacio González.
## plot of individuals for objects of class 'rcc' data(nutrimouse) X <- nutrimouse$lipid Y <- nutrimouse$gene nutri.res <- rcc(X, Y, lambda1 = 0.064, lambda2 = 0.008) plotIndiv(nutri.res, comp1 = 1, comp2 = 2) #(default) col <- rep(c("blue", "red"), c(20, 20)) plotIndiv(nutri.res, comp1 = 1, comp2 = 2, ind.names = nutrimouse$diet, col = col) legend(-2.45, -1.21, 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"), c(16, 16, 16, 16)) 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, comp1 = 1, comp2 = 2, ind.names = FALSE, rep.space = "X-variate", col = col, cex = cex, pch = pch) legend(0.22, -0.24, 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")