View source: R/panel_symbols.R
panel.symbols | R Documentation |
This panel function allows to plot one additional grouping variable encoded by symbols ('pch') instead of just the default grouping by color. Inspired by 'panel.bubbleplot' from package 'tactile'.
panel.symbols(x, y, z, groups = NULL, subscripts, pch = NULL, ...)
x, y |
(numeric) variables to be plotted |
z |
(numeric, factor, character) variable encoding symbols. In not numeric, will be coerced to factorand then numeric if possible |
groups |
grouping variable passed down from xyplot (does not need to be specified) |
subscripts |
subscripts passed down from xyplot (does not need to be specified) |
pch |
not used in this context and set to NULL |
... |
other arguments passed to the function |
library(lattice)
data(mtcars)
# first grouping variable for colors, second for symbols (z)
xyplot(mpg ~ factor(cyl), mtcars,
groups = gear, z = mtcars$cyl,
panel = function(x, y, z, ...) {
panel.symbols(x, y, z, ...)
}
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.