Skip to content
Prev 168969 / 398506 Next

xyplot with lowess curves

Sundar,

That is exactly what I was hoping for. 

Thanks for your help!

Dave

-----Original Message-----
From: Sundar Dorai-Raj [mailto:sdorairaj at gmail.com] 
Sent: Monday, February 02, 2009 12:47 PM
To: Hutchinson,David [PYR]
Cc: r-help at r-project.org
Subject: Re: [R] xyplot with lowess curves

Does this do what you want? The "panel" argument has the custom pane
function I referred to before.

Col <- c("red", "green", "blue", "purple") xyplot (  SnowLineElevation ~
Year | Model,  data = d,  panel = function(x, y, col, ...) {
   Col <- Col[panel.number()]
   panel.xyplot(x, y, col = "blue", ...)
   panel.loess(x, y, col = Col)
 },
 ylim = c(0,100),
 type = c('p','smooth'),
 col = 'blue',
 pch = 21,
 xlab = 'Year',
 ylab = 'Snowline Elevation [m]'
)

On Mon, Feb 2, 2009 at 12:18 PM, Hutchinson,David [PYR]
<David.Hutchinson at ec.gc.ca> wrote: