endpoints (bug?) behavior in xts

Posted by Alex on Stack Overflow See other posts from Stack Overflow or by Alex
Published on 2012-11-09T23:32:13Z Indexed on 2012/11/11 5:01 UTC
Read the original article Hit count: 107

Filed under:
|

If I try to get endpoints for every year, for example, and do the following:

xts.data <- xts(1:10000, order.by=seq(from=as.Date("1970-01-01"), by=1, len=10000))
z <- endpoints(xts.data, on="months", k=12)

The return value for this is:

> z
[1]     0 10000

Same with numbers higher than 12. Why would xts simply not return indices of every year or 13th month starting from the beginning. Is it limited by the number of periods in a year? That is if i did:

 z <- endpoints(xts.data, on="weeks", k=54)

This seems to work fine.

© Stack Overflow or respective owner

Related posts about r

    Related posts about xts