panel.superpose {lattice}R Documentation

Panel Function for Display Marked by groups

Description

These are panel functions for Trellis displays useful when a grouping variable is specified for use within panels. The x (and y where appropriate) variables are plotted with different graphical parameters for each distinct value of the grouping variable.

Usage

panel.superpose(x, y = NULL, subscripts, groups,
                panel.groups = "panel.xyplot",
                col, col.line, col.symbol,
                pch, cex, font,
                fontface, fontfamily,
                lty, lwd, alpha,
                type = "p",
                ...)
panel.superpose.2(x, y = NULL, subscripts, groups,
                  panel.groups = "panel.xyplot",
                  col, col.line, col.symbol,
                  pch, cex, font, 
                  fontface, fontfamily, 
                  lty, lwd, alpha,
                  type = "p",
                  ...)

Arguments

x,y coordinates of the points to be displayed
panel.groups the panel function to be used for each group of points. Defaults to panel.xyplot (behaviour in S)
subscripts subscripts giving indices in original data frame
groups a grouping variable. Different graphical parameters will be used to plot the subsets of observations given by each distinct value of groups. The default graphical parameters are obtained from superpose.symbol and superpose.line using trellis.par.get wherever appropriate
type usually a character vector specifying what should be drawn for each group, passed on to the panel.groups function, which must know what to do with it. By default, this is panel.xyplot, whose help page describes the admissible values.
The two functions panel.superpose and panel.superpose.2 differ only in the way the type argument is interpreted. For the former, the interpretation is the same as for panel.xyplot for each of the unique groups. In other words, if type is a vector, all the individual components are honoured concurrently. For the latter, type is replicated to be as long as the number of unique values in groups, and one component used for the points corresponding to the each different group. Even in this case, it is possible to request multiple types per group, specifying type as a list, each component being the desired type vector for the corresponding plot.
In panel.superpose, any occurrence of "g" in type causes a grid to be drawn, and all such occurrences are removed before type is passed on to panel.groups.
col, col.line, col.symbol, pch, cex, font, fontface, fontfamily, lty, lwd, alpha graphical parameters, replicated to be as long as the number of groups, and eventually ultimately passed down to panel.groups.
... other arguments, passed down to panel.groups.

Author(s)

Deepayan Sarkar Deepayan.Sarkar@R-project.org (panel.superpose.2 originally contributed by Neil Klepeis)

See Also

Different functions when used as panel.groups gives different types of plots, for example panel.xyplot, panel.dotplot and panel.linejoin (This can be used to produce interaction plots).


[Package lattice version 0.12-11 Index]