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 a data.frame called 'sleep' with 'date' as the
date (from as.Date()) and 'hours' as the # hours I slept that night, I would
love to do something like:

qplot(date, hours, data = sleep) + stat_smooth(method = 'movingaverage', k =
7);

does such a thing exist?  If not, I know the package is extensible, so any
guidance as to how make it to do so would be very much appreciated.

Thanks,
Mike
-- 
View this message in context: 
http://n4.nabble.com/Moving-Averages-in-ggplot2-tp958867p958867.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help@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.

Reply via email to