| plot3dVar {integrOmics} | R Documentation |
This function provides variables representation in three dimensions for (regularized) CCA and (sparse) PLS regression.
## S3 method for class 'rcc':
plot3dVar(object, comp = 1:3, rad.in = 0.5,
cutoff = NULL, X.label = FALSE, Y.label = FALSE,
pch = NULL, cex = NULL, col = NULL, font = NULL,
axes.box = "all", label.axes.box = "both",
xlab = NULL, ylab = NULL, zlab = NULL, ...)
## S3 method for class 'pls':
plot3dVar(object, comp = 1:3, rad.in = 0.5,
keep.var = FALSE, X.label = FALSE, Y.label = FALSE,
pch = NULL, cex = NULL, col = NULL, font = NULL,
axes.box = "all", label.axes.box = "both",
xlab = NULL, ylab = NULL, zlab = NULL, ...)
## S3 method for class 'spls':
plot3dVar(object, comp = 1:3, rad.in = 0.5,
keep.var = FALSE, X.label = FALSE, Y.label = FALSE,
pch = NULL, cex = NULL, col = NULL, font = NULL,
axes.box = "all", label.axes.box = "both",
xlab = NULL, ylab = NULL, zlab = NULL, ...)
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 variables. |
rad.in |
numeric between 0 and 1, the radius of the small sphere. Defaults to 0.5. |
cutoff |
numeric between 0 and 1. Variables with correlations below this cutoff in absolute value are not plotted (see Details). |
X.label, Y.label |
either a character vector of names for the X- and
Y-variables or FALSE for no names. If TRUE, the columns names
of the matrice are used as labels. |
col |
character or integer vector of colors for plotted character and items. See Details. |
pch |
character indicating the type of item to plot, possibly vector (see Details). |
cex |
numeric character (or item) expansion (see Details). |
font |
numeric font to be used. See text3d for details. |
keep.var |
boolean. If TRUE only the variables with loadings not zero are plotted
(as selected by spls). Defaults to FALSE. |
axes.box |
character string or vector specifying the axes box type. Should be a subset
of c("axes", "box", "bbox", "all"). |
label.axes.box |
character string indicating whether to label the axes and/or boxes.
Should be a of c("axes", "box", "both") |
xlab, ylab, zlab |
x-, y- and z-axis titles. |
... |
further title parameters are passed to title3d. |
plot3dVar gives an extension of the "correlation circle" to three dimensions, i.e. the correlations
between each variable and the selected components are plotted as scatter plot in three dimensions,
with a sphere of radius given by rad.in centred in the origin. If cutoff is not NULL
the rad.in is ignored and the radius of the sphere is equal to cutoff. For (sparse) PLS
regression the components correspond to
the X-variates components and for (regularized) CCA the components correspond
to the bisector vector components between X- and Y-variates.
The arguments cex, pch and font are vectors of
length two. The firts and second component value determines the graphical attribute for
X- and Y-variables respectively. 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.
The argument col can be either a vector of
length two or a list with two vector components of length p and q respectively,
where p is the number of X-variables and q
is the number of Y-variables. In the first case, the first and second component of the
vector determine the color for the X- and Y-variables respectively.
Otherwise, multiple colors can be specified so that each item (variable)
can be given its own color. In this case, the first component of the list
correspond to the X-color attribut and the second component correspond to
the Y-color attribut.
Ignacio González.
plotVar, plot3dIndiv, text3d,
title3d and rgl.postscript to save the screen shot to a file in PostScript
or other vector graphics format.
require(rgl)
## Not run:
## 3D variable representation for objects of class 'rcc'
data(nutrimouse)
X <- nutrimouse$lipid
Y <- nutrimouse$gene
nutri.res <- rcc(X, Y, 0.064, 0.008)
# default
plot3dVar.rcc(nutri.res)
# cutoff active, labeling the variables
plot3dVar.rcc(nutri.res, cutoff = 0.7, X.label = TRUE, cex = c(0.8, 0.8))
## 3D variable representation for objects of class 'pls' or 'spls'
data(liver.toxicity)
X <- liver.toxicity$gene
Y <- liver.toxicity$clinic
toxicity.spls.1 <- spls(X, Y, ncomp = 3, keepX = c(50, 50, 50),
keepY = c(10, 10, 10))
plot3dVar(toxicity.spls.1, rad.in = 0.5, keep.var = TRUE,
cex = c(1, 0.8), main = "Variables 3D representation")
toxicity.spls.2 <- spls(X, Y, ncomp = 3, keepX = c(10, 10, 10),
keepY = c(10, 10, 10))
plot3dVar(toxicity.spls.2, rad.in = 0.5, keep.var = TRUE,
Y.label = TRUE, main = "Variables 3D representation",
label.axes.box = "axes")
## End(Not run)