[R] Help with date specification

Mark Knecht markknecht at gmail.com
Thu Sep 17 19:00:37 CEST 2009


On Thu, Sep 17, 2009 at 9:11 AM, Subodh Acharya <shoebodh at gmail.com> 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]]
>

subset(x, date>=Apr-96 & date<=Mar))

then do the sum?

- Mark




More information about the R-help mailing list