panel.symbols: Plot a grouping variable encoded by symbols

View source: R/panel_symbols.R

panel.symbolsR Documentation

Plot a grouping variable encoded by symbols

Description

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'.

Usage

panel.symbols(x, y, z, groups = NULL, subscripts, pch = NULL, ...)

Arguments

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

Examples

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, ...)
  }
)


m-jahn/lattice-tools documentation built on Dec. 3, 2023, 11:14 p.m.