## S3 method for class 'rcc':
plot3dVar(object, comp = 1:3, rad.in = 1,
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, \ldots)
## S3 method for class 'pls':
plot3dVar(object, comp = 1:3, rad.in = 1,
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, \ldots)
## S3 method for class 'spls':
plot3dVar(object, comp = 1:3, rad.in = 1,
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, \ldots)
## S3 method for class 'plsda':
plot3dVar(object, comp = 1:3, rad.in = 1,
var.label = FALSE,
pch = NULL, cex = NULL, col = NULL, font = NULL,
axes.box = "all", label.axes.box = "both",
xlab = NULL, ylab = NULL, zlab = NULL, \ldots)
## S3 method for class 'splsda':
plot3dVar(object, comp = 1:3, rad.in = 1,
var.label = FALSE,
pch = NULL, cex = NULL, col = NULL, font = NULL,
axes.box = "all", label.axes.box = "both",
xlab = NULL, ylab = NULL, zlab = NULL, \ldots)
## S3 method for class 'pca':
plot3dVar(object, comp = 1:3, rad.in = 1,
var.label = FALSE,
pch = NULL, cex = NULL, col = NULL, font = NULL,
axes.box = "all", label.axes.box = "both",
xlab = NULL, ylab = NULL, zlab = NULL, \ldots)
## S3 method for class 'spca':
plot3dVar(object, comp = 1:3, rad.in = 1,
var.label = FALSE,
pch = NULL, cex = NULL, col = NULL, font = NULL,
axes.box = "all", label.axes.box = "both",
xlab = NULL, ylab = NULL, zlab = NULL, \ldots)
"rcc"
, "pls"
, "plsda"
,
"spls"
, "plsda"
, "pca"
or "spca"
.1
.FALSE
for no names. If TRUE
, the columns names
of the matrice are used as labels.text3d
for details.c("axes", "box", "bbox", "all")
.c("axes", "box", "both")
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.
For the objects of class rcc
, pls
and spls
a sphere of radius given by rad.in
centred in the origin is displayed. If cutoff
is not NULL
the rad.in
is ignored and the radius of the sphere is equal to cutoff
.
For plsda
and splsda
objects, only the $X$ variables are represented.
For spls
and splsda
objects, only the $X$ and $Y$ variables selected on dimensions
comp
are represented.
The arguments cex
, pch
and font
are vectors of
length two for the objects of class rcc
, pls
and spls
.
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.
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 attribute.
The pointing device of your graphics user-interface can also be used to set the viewpoint interactively.
With the pointing device the buttons are by default set as follows:
- left adjust viewpoint position
- middle adjust field of view angle
- right or wheel adjust zoom factorplotVar
, plot3dIndiv
, text3d
,
title3d
and rgl.postscript
to save the screen shot to a file in PostScript
or other vector graphics format.require(rgl)
## 3D variable representation 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)
\dontrun{
# default
plot3dVar(nutri.res)
# cutoff active, labeling the variables
plot3dVar(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
toxi.spls.1 <- spls(X, Y, ncomp = 3, keepX = c(50, 50, 50),
keepY = c(10, 10, 10))
\dontrun{
plot3dVar(toxi.spls.1, rad.in = 0.5, keep.var = TRUE, cex = c(1, 0.8),
main = "Variables 3D representation")
}
toxi.spls.2 <- spls(X, Y, ncomp = 3, keepX = c(10, 10, 10),
keepY = c(10, 10, 10))
plot3dVar(toxi.spls.2, rad.in = 0.5, Y.label = TRUE,
main = "Variables 3D representation",
label.axes.box = "axes")
## 3D variable representation for objects of class 'pca'
data(multidrug)
pca.res <- pca(multidrug$ABC.trans, ncomp = 4, scale = TRUE)
plot3dVar(pca.res)
## variable representation for objects of class 'splsda'
data(liver.toxicity)
X <- liver.toxicity$gene
Y <- as.factor(liver.toxicity$treatment[, 4])
ncomp <- 3
keepX <- rep(20, ncomp)
splsda.liver <- splsda(X, Y, ncomp = ncomp, keepX = keepX)
\dontrun{
plot3dVar(splsda.liver, var.label = FALSE, Y.label = TRUE, keep.var = TRUE)
}
Run the code above in your browser using DataLab