[R] Using interactive plots to get information about data points

Michael Bibo michael_bibo at health.qld.gov.au
Tue Aug 26 14:40:25 CEST 2008


jcarmichael <jcarmichael314 <at> gmail.com> writes:

> 
> 
> Thank you for the GGobi reference, it is a very handy tool!  My main goal,
> however, is to be able to identify univariate outliers (with boxplots for
> example), and I'm having a hard time getting the rggobi package to do that.
> 
Hmmm...  I guess because GGobi is designed for the "visualization of
high-dimensional data", boxplots of individual vectors isn't a priority.  Sorry
if that was a bad lead. (Still cool software, though!)

You can, however, use identify.  An RSiteSearch for "identify boxplot" will give
you a number of leads.  

I often recommend John Fox's R Commander GUI as a tool to help with learning
syntax.  In this case, the Rcmdr dialogue for boxplots includes a checkbox for
"identify outliers with mouse".  You can use this dialogue with this option
checked, and then examine the syntax to see how it was done:   
 
data(Angell, package="car")
boxplot(Angell$hetero, ylab="hetero")
identify(rep(1, length(Angell$hetero)), Angell$hetero, rownames(Angell))

The results of the RSiteSearch will explain how/why this works. (Hint: the
"rep(1,length(z)),z" pattern essentially defines x,y coordinates of all the
points that make up the boxplot - for a univariate boxplot, all have an 'x'
coordinate of 1). 

In a similar vein, the latticist GUI (package playWith - need GTK libraries or
runtime (windows) installed) has similar functionality with parallel boxplots.

Hope this helps.

Michael Bibo
Queensland Health



More information about the R-help mailing list