Re: [R] alternative to 'groups' for lattice bwplot()

From: Deepayan Sarkar <>
Date: Thu 24 Mar 2005 - 03:38:59 EST

On Wednesday 23 March 2005 00:10, Sebastian Luque wrote:
> Hi,
> Is there some alternative to the 'groups' argument in lattice's
> bwplot function for boxplots? Say in the example below:
> bwplot(yield ~ site | year, data = barley)
> you want to have two side by side boxplots per site, corresponding to
> each year in the barley data frame. Ideally, the space between
> boxplots of the same site should be smaller than that between
> boxplots of different sites.
> This seemed like a job for the 'groups' argument, but panel.bwplot
> doesn't take it. I saw that boxplot() might do this for the
> particular example above, but not for a more complex one with
> additional conditioning variables (as in my actual problem).

I consider bwplot to already provide a grouped display (box plots are univariate summaries, and bwplot allows you to display several of them together within a panel). What you are looking for may be appropriate in certain situations, but is not general enough to warrant a built-in implementation. In other words, you'll have to write your own panel function.

> I thought I'd find something about this in the archives, but I'm
> either not using the right keywords or the question hasn't come up
> yet.

The only instance I can recall is:

Deepayan mailing list PLEASE do read the posting guide! Received on Thu Mar 24 03:44:05 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:30:55 EST