Re: [R] Drawing a loess line

2008-02-03 Thread Marcin Kozak
Yes, this is what I wanted and needed. Thank you all for your replies. Marcin On Feb 4, 2008 1:28 AM, Gabor Grothendieck <[EMAIL PROTECTED]> wrote: > lattice has a type = "smooth" for this: > >library(lattice) >xyplot(dist ~ speed, cars, type = c("smooth", "p")) > > Or with a colored line

Re: [R] Drawing a loess line

2008-02-03 Thread Gabor Grothendieck
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) q

Re: [R] Drawing a loess line

2008-02-03 Thread Gavin Simpson
hits=-2.6 tests�YES_00 X-USF-Spam-Flag: NO On Sun, 2008-02-03 at 22:26 +0100, Marcin Kozak wrote: > Thanks a lot, it works. > > Any ideas what's going on here? > > y<-c(1.75, 1.41, 1.96, 1.03, 2.38, 2.19, 1.81, 1.91, 1.47, 2.25, 1.53, > 2.79, 2.54, 2.36, 2.65, > 2.69, 2.58, 3.27, 3.52, 2.93) > x

Re: [R] Drawing a loess line

2008-02-03 Thread Henrique Dallazuanna
Try this: plot(x, y) points(x, predict(fit), pch=16, col="blue") On 03/02/2008, Marcin Kozak <[EMAIL PROTECTED]> wrote: > Thanks a lot, it works. > > Any ideas what's going on here? > > y<-c(1.75, 1.41, 1.96, 1.03, 2.38, 2.19, 1.81, 1.91, 1.47, 2.25, 1.53, > 2.79, 2.54, 2.36, 2.65, > 2.69, 2.58,

Re: [R] Drawing a loess line

2008-02-03 Thread Marcin Kozak
Thanks a lot, it works. Any ideas what's going on here? y<-c(1.75, 1.41, 1.96, 1.03, 2.38, 2.19, 1.81, 1.91, 1.47, 2.25, 1.53, 2.79, 2.54, 2.36, 2.65, 2.69, 2.58, 3.27, 3.52, 2.93) x<-c(0.59, 0.49, 0.65, 0.41, 0.84, 0.87, 0.69, 0.72, 0.67, 0.93, 0.76, 1.04, 0.87, 0.92, 0.92, 1.04, 0.94, 1.15, 1.1

Re: [R] Drawing a loess line

2008-02-03 Thread Henrique Dallazuanna
Try this: cars.lo <- loess(dist ~ speed, cars) with(cars, plot(speed, dist)) lines(predict(cars.lo), col="blue") On 03/02/2008, Marcin Kozak <[EMAIL PROTECTED]> 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 t

[R] Drawing a loess line

2008-02-03 Thread Marcin Kozak
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-