Re: [R] multiple lowess line in one plot

From: Deepayan Sarkar <deepayan.sarkar_at_gmail.com>
Date: Thu 05 Jan 2006 - 08:39:26 EST

On 1/4/06, Gregory Snow <Greg.Snow@intermountainmail.org> wrote:
> Here is one approach using lattice (trellis) graphics:
>
> tmp.state <- data.frame( Frost=state.x77[,'Frost'],
> Murder=state.x77[,'Murder'],
> Region=state.region)
>
> library(lattice)
> trellis.par.set(col.whitebg())
> xyplot( Murder ~ Frost, groups=Region, data=tmp.state,
> panel.groups=function(...){panel.loess(...);panel.xyplot(...)}
> ,span=.8)

which can be shortened to

xyplot(Murder ~ Frost, groups=Region, data=tmp.state,

       type = c('p', 'smooth'), span = .8)

-Deepayan



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu Jan 05 09:18:12 2006

This archive was generated by hypermail 2.1.8 : Thu 05 Jan 2006 - 14:05:18 EST