plo_inter | R Documentation |
Plots the interaction between two categorical supplementary variables for a PLS regression.
plo_inter(object, var1, var2, excl1 = NULL, excl2 = NULL,
comps = c(1,2), shapesize = 1, textsize = 3,
force = 1, max.overlaps = Inf,
lines = TRUE, dashes = TRUE)
object |
an object of class |
var1 |
factor. The first categorical supplementary variable. |
var2 |
factor. The second categorical supplementary variable. |
excl1 |
character vector of categories from the var1 to exclude from the plot. If NULL (default), all the supplementary categories are plotted. |
excl2 |
character vector of categories from the var2 to exclude from the plot. If NULL (default), all the supplementary categories are plotted. |
comps |
the components to use. Default is |
shapesize |
Size of the shapes. Default is 1. |
textsize |
Size of the labels of categories. Default is 3. |
force |
Force of repulsion between overlapping text labels. Defaults to 1. If 0, labels are not repelled at all. |
max.overlaps |
Exclude text labels that overlap too many things. Defaults to Inf, which means no labels are excluded. |
lines |
logical. Whether to add colored lines between the points of the categories of v1. Default is TRUE. |
dashes |
logical. Whether to add gray dashed lines between the points of the categories of v2. Default is TRUE. |
a ggplot2
object
Nicolas Robette
Martens, H., Næs, T. (1989) Multivariate calibration. Chichester: Wiley.
Tenenhaus, M. (1998) La Regression PLS. Theorie et Pratique. Editions TECHNIP, Paris.
plo_sup
, plo_part
library(pls)
data(mpg, package = "ggplot2")
pls <- mvr(displ ~ cty + hwy + cyl,
ncomp = 3,
data = mpg,
validation = "CV",
method = "oscorespls")
supvars <- data.frame(class = factor(mpg$class), trans = factor(mpg$trans))
plo_inter(pls, factor(mpg$class), factor(mpg$trans), lines = FALSE, dashes = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.