[R] Moving Average on Defined Intervals

2009-07-30 Thread Hadassa Brunschwig
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).

[R] Moving Average on Defined Intervals

2009-07-30 Thread Hadassa Brunschwig
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).

Re: [R] Moving Average on Defined Intervals

2009-07-30 Thread Alain Zuur
Hadassa Brunschwig-2 wrote: 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

Re: [R] Moving Average on Defined Intervals

2009-07-30 Thread Gabor Grothendieck
See ?cut and ?tapply for your first problem. Those together with ?rollappy in the zoo package can likely handle your second problem. In the future please read the last line to every message on r-help before posting. On Thu, Jul 30, 2009 at 6:15 AM, Hadassa