[R] label outliers in boxplot and/or bwplot

Deepayan Sarkar deepayan at stat.wisc.edu
Sat Feb 12 17:01:05 CET 2005


On Saturday 12 February 2005 09:04, John Fox wrote:
> Dear Deepayan,
>
> I wasn't aware of panel.identify(), which I too will find very
> useful. As you say, it is strange that you can identify points that
> aren't plotted; this is the case for my solution for boxplot() as
> well -- though the reason it works there is more obvious (at least to
> me).

It's the same reason really (although it might not have worked if 
panel.bwplot had different arguments). Say you have 

bwplot(gl(2, 5) ~ 1:10)

Then the panel function will get arguments 

x = 1, 2, 3, 4, 5, 6, 7, 8, 9,10
y = 1, 1, 1, 1, 1, 2, 2, 2, 2, 2

which are eventually supplied to panel.identify(), just as in your 
identify() example. The only difference is that panel.identify has 
reasonable defaults for x and y (namely the x and y passed to the 
corresponding panel), which happen to work in this case. This is 
possible because the trellis object is saved (by default) when it's 
printed, and so it's panel arguments can be recovered.

Deepayan




More information about the R-help mailing list