Panel Function for Hexbins

DESCRIPTION:

Panel functions that compute and display hexagonal binning in each panel.

USAGE:

panel.hexbin(x, y, subscripts, hexbin.data, lwd=add.line$lwd, 
    lty=add.line$lty, col=add.line$col, ..., lmline=F, text=!fill, 
    fill=T, maxcount=max(c(0, bin$count)), mincount=1, 
    col.regions=trellis.par.get("regions")$col, count.to.col, border=F)
panel.hexbin.lmline(x, y, subscripts, hexbin.data, lwd = add.line$lwd, 
    lty = add.line$lty, col = add.line$col, ...)
panel.hexbin.loess(x, y, subscripts, hexbin.data, lwd = add.line$lwd, 
    lty = add.line$lty, col = add.line$col, ..., span = 2/3, degree = 1, 
    family = c("symmetric", "gaussian"), evaluation = 50)

REQUIRED ARGUMENTS:

x, y
(unused) the centers of gravity of the hexagonal cells, the same as hexbin.data[subscripts,][,c("x","y")]
subscripts
a vector of subscripts that tells where in the overall data the selected x and y observations originate.
hexbin.data
an object of class hexbin, as produced by the hexbin function. bin=hexbin.data[subscripts, , drop = F] is the part of hexbin.data that belongs in the current panel. The bin's x and y components provide the "center of gravity" of the points in each cell (and are the x and y arguments to panel.hexbin). cell2xy(bin) provides the the geometric centers of the cells. bin$count gives the counts in each cell.

OPTIONAL ARGUMENTS:

lwd
the width of lines. Used only if lmline is set to TRUE.
lty
the type of lines. Used only if lmline is set to TRUE.
col
the line color. Used only if lmline is set to TRUE.
...
additional specified graphical parameters.
lmline
a logical value specifying whether to include a linear regression line.
text
a logical value. If TRUE, print the count in each cell.
fill
a logical value. If FALSE, do not color in the hexagonal cells.
maxcount
ignored.
mincount
ignored.
col.regions
the color indices from count.to.col are subscripts into this list of colors.
count.to.col
A function that maps the cell count to a color index.
border
A logical. If TRUE, draws borders around each hexagonal cell.
span
smoothing parameter for panel.hexbin.loess.
degree
overall degree of locally-fitted polynomial. 1 is locally-linear fitting and 2 is locally-quadratic fitting.
family
The values are "gaussian" or "symmetric". In the first case, local-fitting methods are used. In the second case, the default, local fitting is used together with a robustness feature that guards against distortion by outliers.
evaluation
number of values at which the loess curve is evaluated.

SIDE EFFECTS:

A hexbin plot is drawn on the display based on x and y values.

DETAILS:

The x and y components are required by the underlying Trellis function, but for this function, they are supplied by hexbin.data.

SEE ALSO:

,

EXAMPLES:

library(bigdata)
xyplot(data=as.bdFrame(fuel.frame), Disp.~Weight|Type,
panel = function(...) { panel.hexbin(...)})
#as.bdFrame requires loadin the big data library.