Re: [R] How to produce notches in bwplot?

From: Deepayan Sarkar <deepayan.sarkar_at_gmail.com>
Date: Mon 27 Feb 2006 - 08:04:00 EST

On 2/26/06, Michael Kubovy <kubovy@virginia.edu> wrote:
> Dear r-helpers,
>
> tst <- data.frame(as.numeric(x <- 1:20), f <- rep(c('hi','lo'), times
> = 10))
> with(tst, bwplot(f ~ x, panel = function(x, y){panel.bwplot(x, y, pch
> = '|', stats = boxplot.stats, fill = 8, varwidth = T)}))
>
> I can't figure out from the documentation how to tell stats that I
> would like to see notches or (even bands).
>
> Here is what I've done. (By the way, there is something about the
> style of R documentation that has --- more than once --- led me to
> these kinds of problems.)
> RSiteSearch('bwplot notch') gives me nothing (as well as other
> similar queries).
> xyplot {lattice} tells me about panel.bwplot, but does not illustrate
> its use.

Well, ?xyplot, which is the same as ?bwplot, does give you examples of calls to bwplot. If you want, you can imagine adding 'panel=panel.bwplot' to that call (which is redundant because that's the default). I'm not sure what other ``illustrative use'' you were hoping for.

> panel.bwplot {lattice} tells me about the fact that the default
> setting of stats to boxplot.stats, but doesn't give an example.
> boxplot.stats {grDevices} tells me that the default setting is
> do.conf = TRUE, which I gathered meant that notches would be computed
> and hence plotted.
>
> Does anyone have advice about how I could have gone about finding out
> how to do this (preferably from documentation rather than reading code)?

You cannot add notches using the default panel function for bwplot, i.e. panel.bwplot. Since you found no indication in the documentation that you could, I would say that the documentation was successful :-).

It's hard enough documenting features that are available, so you can't really expect a list of features that are not implemented. This case is somewhat unusual, since this is a feature available in boxplot but missing in panel.bwplot, so I'll add a note.

Of course, you can always write your own panel function that implements notches.

Deepayan

--
http://www.stat.wisc.edu/~deepayan/

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Mon Feb 27 08:13:29 2006

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:42:45 EST