[R-SIG-Finance] Applying function on rolling window basis ** not rollapply() function in zoo

Brian G. Peterson brian at braverock.com
Tue Jan 4 14:07:14 CET 2011


On 01/04/2011 07:20 AM, Bogaso Christofer wrote:
> Hi all, in the zoo package there is a function rollapply() to apply some
> fixed function on rolling window basis. I am looking for some same sort of
> function on **temporal sampling basis** means, I would like to apply a
> function say mean() for data window of length 30 like observations for 1:30,
> 31:60, . so on.


?period.apply  # for time series based apply

?apply.rolling # to apply with a fixed (rolling) width

or maybe the 'by' argument of rollapply.

   - Brian



More information about the R-SIG-Finance mailing list