group
) are plottedlowess.bygroup(x, y, group, span=2/3, col=seq(along=x), lty=seq(along=x))
gr <- c(rep(1,20),rep(2,30),rep(3,50))
x <- seq(along=gr); y <- jitter(0.01*(x-50)^2 + 1,1000)
plot(x,y,pch=".",cex=4)
lowess.bygroup(x,y,gr,span=0.2,col=c("red","green","magenta"),lty=rep(2,3))
lowess.bygroup(x,y,gr,span=0.4,col="blue")
Run the code above in your browser using DataLab