Skip to content

How to produce notches in bwplot?

3 messages · Deepayan Sarkar, Michael Kubovy

#
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.
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)?
_____________________________
Professor Michael Kubovy
University of Virginia
Department of Psychology
USPS:     P.O.Box 400400    Charlottesville, VA 22904-4400
Parcels:    Room 102        Gilmer Hall
         McCormick Road    Charlottesville, VA 22903
Office:    B011    +1-434-982-4729
Lab:        B019    +1-434-982-4751
Fax:        +1-434-982-4766
WWW:    http://www.people.virginia.edu/~mk9y/
#
On 2/26/06, Michael Kubovy <kubovy at virginia.edu> wrote:
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.
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/
#
Deepayan,

Thanks so much for the clarification(i.e., that one cannot produce  
notches in boxplots using bwplot). I hope that I did not come across  
as being critical of the superb and selfless work that you have done.
_____________________________
Professor Michael Kubovy
University of Virginia
Department of Psychology
USPS:     P.O.Box 400400    Charlottesville, VA 22904-4400
Parcels:    Room 102        Gilmer Hall
         McCormick Road    Charlottesville, VA 22903
Office:    B011    +1-434-982-4729
Lab:        B019    +1-434-982-4751
Fax:        +1-434-982-4766
WWW:    http://www.people.virginia.edu/~mk9y/