Skip to content

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

8 messages · Peter Ehlers, Santosh, Duncan Mackay +2 more

#
Can you clarify how many curves you want in each panel?
You have 3 Ys and your original email indicated at least
7 ID values. Do you really want 21 curves in each panel?
Or do you want separate panels for the Ys?

Re your code: note that, regarding a formula of the
type y1 + y2 ~ x, ?xyplot says:

"This feature cannot be used in conjunction with
the groups argument."

  -Peter Ehlers
Santosh wrote:

  
    
#
Hi

I missed the earlier emails and I am not too sure of what you want but have 
a look at

requiire(latticeExtra)
? useOuterStrips

It may improve the layout and readability


Duncan Mackay
Department of Agronomy and Soil Science
University of New England
ARMIDALE NSW 2351
Email Home: mackay at northnet.com.au
At 14:14 5/01/2010, you wrote:
#
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