| classbiplot | R Documentation |
This helper plots the individuals and predictors from a fitted
plsR or plsRglm model while coloring the
individuals according to a grouping variable.
classbiplot(
object,
group = NULL,
comps = 1:2,
col,
colvar = "gray30",
pch = 19,
cex = rep(par("cex"), 2),
xlabs = NULL,
ylabs = NULL,
point.labels = FALSE,
show.legend = TRUE,
legendpos = "topright",
var.axes = TRUE,
expand = 1,
xlim = NULL,
ylim = NULL,
arrow.len = 0.1,
main = NULL,
sub = NULL,
xlab = NULL,
ylab = NULL,
...
)
object |
an object containing score and loading matrices in
|
group |
optional grouping vector for the individuals. When supplied,
observations are colored according to the levels of |
comps |
integer vector of length 2 giving the components to display. |
col |
colors for the individuals. If |
colvar |
color used for variable labels, arrows and axes. |
pch |
plotting character for the individuals. |
cex |
character expansion. Length 1 is recycled to length 2: the first value is used for the individuals and the second one for the variables. |
xlabs |
optional labels for the individuals. |
ylabs |
optional labels for the variables. |
point.labels |
shall the individuals be displayed using text labels
instead of points? Defaults to |
show.legend |
shall a legend be added when |
legendpos |
position of the legend as in
|
var.axes |
shall arrows be drawn for the variables? Defaults to
|
expand |
expansion factor for the variables layer, as in
|
xlim, ylim |
limits for the scores panel. When both are missing they are
chosen symmetrically as in |
arrow.len |
length of the arrows for the variables. |
main, sub, xlab, ylab |
usual graphical parameters passed to
|
... |
further graphical parameters passed to
|
Invisibly returns a list with the scores, loadings, colors, grouping factor and scaling ratio used in the plot.
Frédéric Bertrand
frederic.bertrand@lecnam.net
https://fbertran.github.io/homepage/
plsR, plsRglm,
biplot
data(Cornell)
modpls <- plsR(Y ~ ., data = Cornell, nt = 2)
grp <- factor(Cornell$Y > median(Cornell$Y), labels = c("Low", "High"))
classbiplot(modpls, group = grp, col = c("firebrick3", "steelblue3"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.