| plot3dIndiv {integrOmics} | R Documentation |
This function provides scatter plots of individuals (experimental units) in three dimensions for (r)CCA and (s)PLS regression.
## S3 method for class 'rcc':
plot3dIndiv(object, comp = 1:3, ind.names = TRUE,
rep.space = c("X-variate", "Y-variate"),
xlab = NULL, ylab = NULL, zlab = NULL,
col = "black", cex = 1, pch = "s", font = 1,
axes.box = "box", ...)
## S3 method for class 'pls':
plot3dIndiv(object, comp = 1:3, ind.names = TRUE,
rep.space = c("X-variate", "Y-variate"),
xlab = NULL, ylab = NULL, zlab = NULL,
col = "black", cex = 1, pch = "s", font = 1,
axes.box = "box", ...)
## S3 method for class 'spls':
plot3dIndiv(object, comp = 1:3, ind.names = TRUE,
rep.space = c("X-variate", "Y-variate"),
xlab = NULL, ylab = NULL, zlab = NULL,
col = "black", cex = 1, pch = "s", font = 1,
axes.box = "box", ...)
object |
object of class inheriting from "rcc", "pls" or "spls". |
comp |
an integer vector of length 3, the components that will be used on the x-axis, the y-axis and z-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",
or "Y-variate", determining the subspace to project the
individuals. Defaults to "X-variate". |
xlab, ylab, zlab |
x-, y- and z-axis titles. |
col |
character (or item) color to be used, possibly vector (see Details). |
cex |
numeric character (or item) expansion, possibly vector (see Details). |
pch |
character indicating the type of item to plot, possibly vector (see Details). |
font |
character font to be used, possibly vector (see Details). |
axes.box |
character string specifying the axes box type. Should be a
of c("box","bbox", "both"). |
... |
further title parameters are passed to title3d. |
plot3dIndiv method makes scatter plot for individuals representation in three dimensions
depending on the variate components selected and the subspace of projection.
Each item 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, pch and font 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 item (individual)
can be given its own graphic attributes. Default values exist for this arguments.
Supported types for pch are: "s" for spheres, "t" for tetrahedrons, "c" for cubes,
"o" for octahedrons, "i" for icosahedrons and "d" dodecahedrons. Partial matching is used.
Ignacio González
plotIndiv, plot3dVar, text3d, title3d and rgl.postscript to save the screen shot to a file in PostScript or other vector graphics format.
require(rgl)
## Not run:
## plot3d 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)
col = nutrimouse$diet
font = c(rep(1, 20), rep(3, 20))
plot3dIndiv(nutri.res, ind.names = nutrimouse$diet,
axes.box = "box", font = font, col = col)
pch = c(rep("s", 20), rep("t", 20))
plot3dIndiv(nutri.res, ind.names = FALSE, axes.box = "both",
col = col, cex = 1.5, pch = pch)
## plot3d 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))
Time.Group = liver.toxicity$treatment[, "Time.Group"]
col <- rep(c("blue", "red", "darkgreen", "darkviolet"), c(16, 16, 16, 16))
plot3dIndiv(toxicity.spls, ind.names = Time.Group,
col = col, cex = 0.8)
col <- rainbow(48)[Time.Group]
plot3dIndiv(toxicity.spls, ind.names = FALSE,
col = col, cex = 0.3, axes.box = "both")
## End(Not run)