[R] Moving Average on Defined Intervals

Hadassa Brunschwig hadassa.brunschwig at mail.huji.ac.il
Thu Jul 30 12:15:51 CEST 2009


Hi all

I have been looking (in the help archives) for a function
which does a moving average. Nothing new, I know.
But I am looking for a function which is very flexible:
The user should be able to input a vector of breaks
which define the bins (and not just the number of observations in a bin).
The function would then calculate which observations fall into this bin
and calculate, say, an average.
Another parameter should be the overlap (probably only when
the breaks of the bins are equidistant).

I am sure I am not the first one to think about this problem.
Thanks for any hints.
Hadassa

-- 
Hadassa Brunschwig
PhD Student
Department of Statistics
The Hebrew University of Jerusalem
http://www.stat.huji.ac.il




More information about the R-help mailing list