[R] Calculate a function repeatedly over sections of a ts object

Jorge Molinos JGARCIAM at tcd.ie
Thu Jan 26 20:24:04 CET 2012


Hi,

I want to apply a function (in my case SDF; package “sapa”) repeatedly over discrete sections of a daily time series object by sliding a time window of constant length (e.g. 10 consecutive years or 1825 days) over the entire ts at increments of 1 time unit (e.g. 1 year or 365 days). So for example, the first SDF would be calculated for the daily values of my variable recorded between years 1 to 5, SDF2 to those for years 2 to 6 and so on until the total length of the series is covered. How can I implement this into a R script? Any help is much appreciated.

Jorge


More information about the R-help mailing list