Panel Function for Superposition

USAGE:

panel.superpose(x, y, subscripts, groups, type = "p", ...) 

ARGUMENTS:

x
horizontal coordinates of data points.
y
vertical coordinates of data points.
subscripts
subscripts for original data that describe where x and y came from.
groups
a factor or character vector that describes the groups that all the data points belong to. groups[subscripts] is the same length as x and y and gives the groups corresponding to the x and y values on this panel. This argument can be specified at the high-level function which calls panel.superpose (see example below).
type
character string (or vector of such) telling how to plot the x and y values in each group: "p" for points, "l" for lines, and "b" for both.
...
graphical parameters that are passed to points or lines. They can be vectors corresponding to different groups of the data. By default, the trellis parameter list superpose.symbol controls character size ( cex), plotting symbol ( pch), font ( font), and color ( col) for points; the superpose.line parameters control line width ( lwd), line type ( lty), and color ( col) for lines. If plotting both points and lines ( type="b") the superpose.symbol colors are used.
Note that both superpose.symbol and superpose.line give vectors of values for their graphical parameters.

SIDE EFFECTS:

A scatter plot or connected line plot is drawn a group at a time in the order specified by the levels of groups. The graphical parameters are adjusted for each group.

SEE ALSO:

, .

EXAMPLES:

n <- length(levels(barley$year)) 
dotplot(variety ~ yield | site, data = barley, groups = year, 
        panel = function(x, y, ...) { 
                dot.line <- trellis.par.get("dot.line") 
                abline(h = y, lwd = dot.line$lwd, lty = dot.line$lty, 
                       col = dot.line$col) 
                panel.superpose(x, y, ...) 
        }, 
        layout = c(1, 6),  
        aspect = 0.5,  
        xlab = "Barley Yield (bushels/acre)", 
        main = "(Superpose Example)",  
        key = list(y = 1.03,  
                   points = Rows(trellis.par.get("superpose.symbol"), 1:n),  
                   text = list(levels(barley$year)), columns = n))