[R] Adding site id to xyplot

Deepayan Sarkar deepayan.sarkar at gmail.com
Fri Jun 19 19:34:17 CEST 2009


On 6/19/09, SEUNG CHEON HONG <seunghong at wisc.edu> wrote:
> Dear R Lists,
>
>  Can anyone help me add site IDs (site: 1~50) directly to my xyplot. I have 50 sites and collected observations from the sites at 13 different time points. I want to look at the change of my observations in each site. I was able to make a graph using xyplot, however, I can't find how to add site IDs within the graph not adding them in the legend. Overall, I would like to be able to recognize lines matching respective site IDs.
>
>  Here is the code (source: MASS) I used below:
>
>  library(lattice)
>  sps <- trellis.par.get("superpose.symbol")
>  sps$pch <- 1:13
>  trellis.par.set("superpose.symbol", sps)
>  xyplot(CADapt~Date, data= omni.sb08, groups=Plot2,
>         panel = panel.superpose, type="b"
>  )

Have you tried adding 'auto.key=TRUE' to your call? If that is along
the lines of what you were hoping for, read the entries for 'key' and
'auto.key' in ?xyplot for details.

-Deepayan




More information about the R-help mailing list