Re: [R] Moving Averages in ggplot2

2009-12-10 Thread Gabor Grothendieck
You probably want to use a time series package for this. There are plotting facilities specifically aimed at time series in zoo, xts, quantmod, timeSeries and latticeExtra. We illustrate with zoo which has classic graphics and lattice graphics methods: devAskNewPage(TRUE) library(zoo) set.seed(

[R] Moving Averages in ggplot2

2009-12-10 Thread fruminator
Hello all, Have some time series data stored in a data.frame, and am plotting it with ggplot2 (which is totally awesome). I have explored the documentation and mailing list archives, and I can't see any way to plot a 'smoother' that is just the K-step moving average. For example, imagine I had