[R] possible problem with "endpoints"?

Joshua Ulrich josh.m.ulrich at gmail.com
Thu Mar 17 16:15:20 CET 2011


Hi Erin,

On Thu, Mar 17, 2011 at 1:27 AM, Erin Hodgess <erinm.hodgess at gmail.com> wrote:
> Dear R People:
>
> Hello again!
>
> I found something unusual in the behavior of the "endpoints" function
> from the xts package:
>
>> x1 <- ts(1:24,start=2008,freq=12)
>> dat <- seq(as.Date("2008/01/01"),length=24,by="months")
>> library(zoo);library(xts)
>> x2 <- zoo(1:24,order=dat)
>> #Here is the surprise:
>> endpoints(as.xts(x1),'quarters')
>  [1]  0  1  4  7 10 13 16 19 22 24
>> endpoints(as.xts(x2),'quarters')
> [1]  0  3  6  9 12 15 18 21 24
>
>
> Shouldn't the endpoints be the same, please?  What am I doing wrong, please?
>
Looks like a timezone issue.  I'll investigate further.

> endpoints(as.xts(x1,tz="GMT"),'quarters')
[1]  0  3  6  9 12 15 18 21 24

> Thanks,
> Erin
>
>
> --
> Erin Hodgess
> Associate Professor
> Department of Computer and Mathematical Sciences
> University of Houston - Downtown
> mailto: erinm.hodgess at gmail.com
>
> ______________________________________________
> R-help at r-project.org 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.
>

--
Joshua Ulrich  |  FOSS Trading: www.fosstrading.com



More information about the R-help mailing list