Learn R Programming

Kmisc (version 0.5.0)

bwplot2: Custom Lattice Boxplot

Description

This generates a custom lattice boxplot; we super-impose actual plot points for groups with a small number of points, and also restrict plotting of the boxplot for these as well (since they are really rather mis-representative of the distribution when there are so few points.) The downside is that functionality is not implemented for multi-panel plots.

Usage

bwplot2(form, data = NULL, xlab = NULL, ylab = NULL, main = NULL, n = 10, ...)

Arguments

form
a formula object as expected by lattice's xyplot.
data
see xyplot.
xlab
see xyplot.
ylab
see xyplot.
main
see xyplot.
n
number of points necessary for a boxplot to be drawn.
...
additional arguments passed to xyplot call.

Details

Axis labels are inferred from the form object passed in when possible.

Examples

Run this code
set.seed(123)
dat <- data.frame( y=rnorm(100), x=factor( rbinom(100,size=2,p=0.8) ) )
bwplot2( x ~ y , dat)

Run the code above in your browser using DataLab