[R] DRAW TWO REGRESSION CURVES IN ONE GRAPH
Greg Snow
Greg.Snow at imail.org
Mon Feb 1 18:35:07 CET 2010
To expand on Gabor's response, using type=c("p","smooth") will closer replicate the effect of the scatter.smooth function.
--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org
801.408.8111
> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of Gabor Grothendieck
> Sent: Saturday, January 30, 2010 4:18 PM
> To: ATANU
> Cc: r-help at r-project.org
> Subject: Re: [R] DRAW TWO REGRESSION CURVES IN ONE GRAPH
>
> On Sat, Jan 30, 2010 at 12:39 PM, ATANU <ata.sonu at gmail.com> wrote:
> > how can i draw two regression curves in one graph??i can draw them
> seperately
> > using scatter.smooth.but can"t adjust them in one single graph
>
> Using the built in iris data frame:
>
> library(lattice)
> xyplot(Sepal.Length ~ Sepal.Width, iris, group = iris$Species, col =
> 1:3, type = c("p", "r"))
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-
> guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help
mailing list