Conditioning Plots/Scatter Plots

DESCRIPTION:

Create Trellis scatterplots. A modified version of the plot is created if the data argument is a bigdata bdFrame (see the DETAILS).

USAGE:

xyplot(formula, ...) 
The following arguments have special meaning within this function. The common meanings for these and all other arguments are listed separately under trellis.args.

ARGUMENTS:

formula
a formula in the form y ~ x | g1 * g2 * ... however the given variables g1, g2, ... may be omitted. The x and y values in formula should both be numeric.
xbins
the size of the hexbin grid. Only used if data is a bdFrame.
col.regions
the colors used for the hexbins. Only used if data is a bdFrame.
maxcount
a numeric value, map this value to the last color. This may be useful to make several splom plots have the same mapping of count to color. Only used if data is a bdFrame.

VALUE:

an object of class trellis, which is automatically plotted by print.trellis.

DETAILS:

If the data argument is a bdFrame then a hexbin plots are drawn in each panel instead of scatterplot. A color key is drawn at the side to show the color - count mapping.

SEE ALSO:

,

EXAMPLES:

EE <- equal.count(ethanol$E, number = 9, overlap = 0.25) 
xyplot(NOx ~ C | EE, data = ethanol, 
       prepanel = function(x, y) prepanel.loess(x, y, span = 1), 
       panel = function(x, y) { 
                 panel.grid(h = 2) 
                 panel.xyplot(x, y) 
                 panel.loess(x, y, span = 1) 
        }, 
        aspect = 2.5, # banking to 45 deg. makes aspect too big 
        layout = c(5, 2), 
        xlab = "Compression Ratio", ylab = "NOx (micrograms/J)") 
xyplot(incidence ~ year, data = melanoma, aspect="xy", 
       xlab = "Year", ylab = "Incidence", ylim = c(0,5)) 
states <- data.frame(state.x77, 
                     state.name = dimnames(state.x77)[[1]], 
                     state.region = state.region) 
xyplot(Murder ~ Population | state.region, data = states, 
       groups = as.character(state.name), 
       panel = function(x, y, subscripts, groups)  
       text(x, y, groups[subscripts])) 
# Passing data to a panel function for use in labeling observations
d <-data.frame(X=rep(c("X1","X2"), rep(10,2)),
        Y=1:20, Z=(1:20)^2, Who=I(paste("No.",1:20)))
xyplot(data=d, Z~Y|X, subscripts=T, panel.data=d,
        panel=function(x,y,subscripts,...,panel.data){
              panel.xyplot(x,y)
              text(x,y,lab=panel.data$Who[subscripts])
        })