[R] Graphics overview

Peter Dalgaard p.dalgaard at biostat.ku.dk
Tue Oct 21 14:33:05 CEST 2003


Prof Brian Ripley <ripley at stats.ox.ac.uk> writes:

> On Tue, 21 Oct 2003, Christoph Bier wrote:
> 
> > Hi,
> > 
> > is there an graphics overview, where the graphic capabitlities 
> > of R are shown with the corresponding code? I already tested 
> > 'demo(graphics)', that isn't that comprehensive, 
> > 'demo(image)', 'demo(lattice)', searched the Mailarchive, 
> > googled and the FAQ keeps silent, too.
> >     For example, I know how a special graphic I need should 
> > look like, but I don't know how to realise it. I even don't 
> > know how to describe it =).
> 
> Chapter 4 of MASS (the book) is a pretty comprehensive set of examples, 
> but given that there are lots of plots associated with e.g. multivariate 
> analysis (try chapter 11 of MASS) and time series (try chapter 14 of MASS) 
> the scope is enormous.
> 
> >     Another example, much more simpler (I hope): I want to get 
> > the sum of the values in a plot above the columns. Like this:
> > 
> > |       3
> > |  2    _
> > |  _   | |
> > | | |  | |
> > |_|_|__|_|__
> >     A    B
> > 
> >     RTMFs are welcome =/. But I read 'help(plot)' (plot is 
> > what I actually use for the graphic above¹) and 'help(par)', 

(Read the muckin' *what*?? ;-) )
 
> It looks like a barplot to me.
> 
> > searched my introduction to S and S-Plus and I'm still waiting 
> > for "Introductory Statistics with R" (P. Dalgaard), that is 
> > not deliverable at the moment.

That book tries rather hard to show only the basic procedure and
not to do fancy things, so this is not explicitly covered in there. It
does describe barplot() and text(), though. (Odd, BTW, www.springer.de
says it ships within 3 days).
 
> There is an example of that in the MASS package script ch04.R
> The means to do it are described in `An Introduction to R' (and 
> elsewhere).

Also, try 

par(ask=T); example(barplot)

The fourth example is fairly close to what you want to do (colSums
instead of colMeans should place the numbers at the end of the
columns). 

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907




More information about the R-help mailing list