Subodh
Assuming the data is ordered by date then you can define
fin.years = (0:(10*12-1)) %/% 12

then use aggregate:
aggregate(x, list(fin.years),sum)

HTH
Schalk Heunis


On Thu, Sep 17, 2009 at 6:11 PM, Subodh Acharya <[email protected]> wrote:

> Hi everyone,I have a data daily data (x) for 10 years starting from
> 04-01-1995 to 03-31-2005.
> I was able to get the yearly sum for the ten years using
> aggregate(x, years, sum).
> But this gave me the yearly sum for 1995 (Apr- Dec); 1996 (Jan-Dec)
> ---------2005 (Jan-Mar).
> But I want to get the aggregates for Apr-1995 to Mar 1996, Apr 1996- mar
> 1997 and so on.
>
> your help will be higly appreciated.
> Thanks in advance
>
> --
> Acharya, Subodh
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> [email protected] 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.
>

        [[alternative HTML version deleted]]

______________________________________________
[email protected] 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