[R] Adding site id to xyplot

SEUNG CHEON HONG seunghong at wisc.edu
Fri Jun 19 17:23:12 CEST 2009


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"
)

Thank you very much in advance!

Steve Hong




More information about the R-help mailing list