Skip to content
Prev 2364 / 15274 Next

endpoints function in package xts [C1]

Hi Anass,

The question I have is -- what is the basis for the time stamps at 14
and 15, yet not at 13?  The problem from the endpoints function
perspective is just that - what would be the logic needed to get your
timestamps?  Would you like stamps that reflect the last obs. in the
time period (which is what endpoints does), or would you like
timestamps at the end/beginning of each hour from the start of the
series to the end?  Additionally the endpoints will pick the last
point within the hour - so 14:00 would be considered the _beginning_
of the 14th hour, 14:59:59 would be the end.

If you just want time stamps from each hour if not represented
already, that would certainly be doable - though not automatically at
present.  Possibly an addition to xts in the near future??

There are two soon to be exported functions from xts: lastof and
firstof, which essentially calculate the last_of an hour (or any
period), that may be of use:
[1] "2008-03-10 14:59:59 GMT"
[1] "2008-03-10 14:00:00 GMT"


You may be able to merge a series of all your required time stamps
with the series in question and get something approximately near what
you are seeking - but you'll most likely have to have stamps at each
hour, not just arbitrary ones.

Jeff
On Mon, Apr 7, 2008 at 6:26 AM, <anass.mouhsine at sgcib.com> wrote: