Skip to content
Prev 205411 / 398506 Next

xyplot - help with multiple Y's vs. X of a member data in multiple panels

You should reshape the data into a long format, and an easy way to do
that is to use the 'reshape' package:

library(reshape)
mdat <- melt(dat, measure.vars = c("y1", "y2", "y3"))

I'm still not sure what you want in the plot. Confusingly, your last
example dropped the "ID" you referred to earlier, and appears to use
"grp1" in the same role.

Maybe something like this:

xyplot(value ~ x | paste(gp2, gp3), mdat,
       groups = paste(variable, gp1), type = "l",
       auto.key = list(lines = TRUE, columns = 3),
       par.settings = simpleTheme(col = 1:8, lty = rep(1:3, each = 8)))



2010/1/5 Santosh <santosh2005 at gmail.com>:
-- 
Felix Andrews / ???
Postdoctoral Fellow
Integrated Catchment Assessment and Management (iCAM) Centre
Fenner School of Environment and Society [Bldg 48a]
The Australian National University
Canberra ACT 0200 Australia
M: +61 410 400 963
T: + 61 2 6125 4670
E: felix.andrews at anu.edu.au
CRICOS Provider No. 00120C