Skip to content
Prev 199900 / 398502 Next

End of Month date capture

Here is one possibility using aggregate.zoo
x1 x2 x3 x4 x5 x6
Aug 1998 -0.07043759 NA NA NA NA NA
Sep 1998 -0.03098945 NA NA NA NA NA
Oct 1998 -0.00726802 NA NA NA NA NA

The above is not strictly what you asked for since it uses yearmon
times.  Here is another solution in which we create a new zoo object
of sequential indexes and then extract the aggregated indexes from z.
This also uses aggregate.zoo:
x1 x2 x3 x4 x5 x6
1998-08-31 -0.07043759 NA NA NA NA NA
1998-09-30 -0.03098945 NA NA NA NA NA
1998-10-23 -0.00726802 NA NA NA NA NA

Here is one that uses aggregate from the core of R rather than aggregate.zoo:
x1 x2 x3 x4 x5 x6
1998-08-31 -0.07043759 NA NA NA NA NA
1998-09-30 -0.03098945 NA NA NA NA NA
1998-10-23 -0.00726802 NA NA NA NA NA
On Wed, Nov 11, 2009 at 10:06 AM, Research <risk2009 at ath.forthnet.gr> wrote: