[R] Panel of pie charts
Gavin Simpson
gavin.simpson at ucl.ac.uk
Tue Jul 29 19:07:50 CEST 2008
On Tue, 2008-07-29 at 17:23 +0100, Richard.Cotton at hsl.gov.uk wrote:
> > I am looking to making a panel of pie charts fo some of my
> > dritribution data . I was wondering if there is a way in any R
> > package to write a small script to do so.
> pie() will do you a one-off pie chart, but there is no equivalent using
> grid/ lattice graphics. You could write a panel.pie function to draw
> them, but be warned: pie charts are almost never the best option for
> displaying data. (See
> http://www.perceptualedge.com/articles/visual_business_intelligence/save_the_pies_for_dessert.pdf
> for example.) Have you considered using barcharts instead?
All concerns about pie charts aside, Deepayan has already done this for
you, as part of his excellent book, Lattice: Multivariate data
Visualization with R (2008) Springer, part of the UseR series.
Check out the book's website for the code to reproduce all the figures:
http://lmdvr.r-forge.r-project.org/figures/figures.html
in particular you should look at chapter 14, figure 14.5 and the
associated code, including panel functions, to reproduce this figure.
HTH
G
--
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
Dr. Gavin Simpson [t] +44 (0)20 7679 0522
ECRC, UCL Geography, [f] +44 (0)20 7679 0565
Pearson Building, [e] gavin.simpsonATNOSPAMucl.ac.uk
Gower Street, London [w] http://www.ucl.ac.uk/~ucfagls/
UK. WC1E 6BT. [w] http://www.freshwaters.org.uk
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
More information about the R-help
mailing list