Interactive graphics

Anthony Unwin writes,

The sample R code in Appendix C of GCSR (2nd edition) is pretty helpful, but I’m not happy with the graphics (surprise, surprise!). Your code for producing a collection of histograms means that they are all individually scaled. For comparative purposes they should, of course, be common scaled.

I’m looking forward to your reaction to my suggestion that you should incorporate interactive graphics in your course. One nice example of interaction that just occurs to me is to select a group of graphics with the mouse and then ask the system, perhaps via a pop-up dialog as in MANET, to common scale them.

I replied,

Yes, I know we are just faking it with the graphs. No systematic approach. This comes in very clearly in our paper (with Cristian Pasarica and Rahul Dodhia), “Let’s practice what we preach: turning tables into graphs,” where we do a good job converting tables into graphs–but we don’t have a good general system for making the graphs. Each one took a lot of work in R. I’m happy to incorporate interactive graphics in the course but I’m not familiar with how to do them in R (or in any other software). I’m sure there’s stuff out there, I just don’t know where to start.

Antony replied:

Yes, that’s both the advantage and disadvantage. You can do everything, but it often takes time and extra thought. Interactive work requires a different approach. It’s like travelling from A to B. If you walk you are a lot more flexible, but you may never get there. Driving a car along the freeway is restrictive in some ways, but gets you further.

The iPlots package for R (which you can download from the software page of our website http://stats.math.uni-augsburg.de/software/) is a start. Martin Theus’s Mondrian (also available from that website) offers much more in the way of interactive graphics. Mondrian is really only for graphics, though it does use Rserve to get R to do calculations for it in the background (e.g. if you want a smooth on a plot or a density estimate).