[R] How to annotate lattice plots

James Rome jamesrome at gmail.com
Thu Dec 31 22:10:11 CET 2009


I am creating a lattice plot with
with(ordgdp, xyplot(delivery~AAR | GDP_ID, xlab="AAR", ylab="Actual
Arrival Rate"))
which works, and gives me 48 plots, one for each GDP_ID.

But I would like to put the number of hours that each GDP lasted on the
relevant plot. This is given by the following table:
>gdphrs
GDP_ID
21273 21288 21293 21294 21297 21303 21361 21399 21415 21436 21443 21446
21448
    7     6     8     5     7    12    10     3    10     3     6    
9    10
21459 21497 21519 21524 21584 21604 21630 21632 21645 21685 21702 21711
21741
   13     4     3     6    10    10     6     9    12     3     7    
8     4
21744 21787 21818 21844 21846 21858 21881 21950 22022 22043 22044 22053
22072
    1     1     6     5     1    13     4     3     4     1     3    
4     5
22074 22084 22125 22126 22146 22155 22167 22215 22216
    5     6     1     4     8     9     4     6    14

I have Murrell's R Graphics book, but don't see how to do what I want,
at least in Chapter 4. So, how do I do this?
I'd like to call ltext for each of the plots.

Thanks for the help, and Happy New Year,
Jim Rome




More information about the R-help mailing list