Re: [R] Drawing a loess line

From: Gabor Grothendieck <ggrothendieck_at_gmail.com>
Date: Sun, 3 Feb 2008 19:28:28 -0500

lattice has a type = "smooth" for this:

   library(lattice)
   xyplot(dist ~ speed, cars, type = c("smooth", "p"))

Or with a colored line:

   xyplot(dist + dist ~ speed, cars, type = c("p", "smooth"), col = 1:2, distribute.type = TRUE)

In ggplot2 its also a one linear:

   library(ggplot2)
   qplot(speed, dist, data = cars, geom = c("point", "smooth"))

or with a colored line:

   qplot(speed, dist, data = cars) + geom_smooth(colour = "red")

On Feb 3, 2008 3:29 PM, Marcin Kozak <nyggus_at_gmail.com> wrote:
> Dear all,
>
> To draw a lowess line on a plot was a piece of cake; to draw a loess
> line, however, seems not that easy. Is the loess plotting implemented
> at all in relation to the loess function, or do I have to look in
> add-on packages?
>
> Thanks,
> Marcin
>
> ______________________________________________
> 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.
>



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. Received on Mon 04 Feb 2008 - 00:32:51 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 04 Feb 2008 - 04:30:10 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive