R timeBasedSeq中的重复日期
Repeated date in R timeBasedSeq
为什么这个 timeBasedSeq
导致重复 10 月 31 日?
> d <- timeBasedSeq("2010-05-24/2010-11-04/d")
> d[158:164]
[1] "2010-10-28" "2010-10-29" "2010-10-30" "2010-10-31"
[5] "2010-10-31" "2010-11-01" "2010-11-02"
在 R 3.1.2 上使用包 xts 版本 0.9-7
我认为这是一个错误(寻呼@JoshuaUlrich)。当开始日期为夏令时并以标准时间结束时发生:
> xts::timeBasedSeq('20080101/20081109/d')[duplicated(xts::timeBasedSeq('20080101/20081109/d'))]
character(0)
> xts::timeBasedSeq('20080701/20081109/d')[duplicated(xts::timeBasedSeq('20080701/20081109/d'))]
[1] "2008-11-02"
并且在不同的年份:
> xts::timeBasedSeq('20100701/20101109/d')[duplicated(xts::timeBasedSeq('20100701/20101109/d'))]
[1] "2010-11-07"
> xts::timeBasedSeq('20100101/20101109/d')[duplicated(xts::timeBasedSeq('20100101/20101109/d'))]
character(0)
> dd <- seq(as.Date('2010-07-01'), as.Date('2010-11-04') ,1)
> dd[ duplicated(dd) ]
character(0)
已将报告发送至:
> maintainer('xts')
[1] "Jeffrey A. Ryan <jeff.a.ryan@gmail.com>"
为什么这个 timeBasedSeq
导致重复 10 月 31 日?
> d <- timeBasedSeq("2010-05-24/2010-11-04/d")
> d[158:164]
[1] "2010-10-28" "2010-10-29" "2010-10-30" "2010-10-31"
[5] "2010-10-31" "2010-11-01" "2010-11-02"
在 R 3.1.2 上使用包 xts 版本 0.9-7
我认为这是一个错误(寻呼@JoshuaUlrich)。当开始日期为夏令时并以标准时间结束时发生:
> xts::timeBasedSeq('20080101/20081109/d')[duplicated(xts::timeBasedSeq('20080101/20081109/d'))]
character(0)
> xts::timeBasedSeq('20080701/20081109/d')[duplicated(xts::timeBasedSeq('20080701/20081109/d'))]
[1] "2008-11-02"
并且在不同的年份:
> xts::timeBasedSeq('20100701/20101109/d')[duplicated(xts::timeBasedSeq('20100701/20101109/d'))]
[1] "2010-11-07"
> xts::timeBasedSeq('20100101/20101109/d')[duplicated(xts::timeBasedSeq('20100101/20101109/d'))]
character(0)
> dd <- seq(as.Date('2010-07-01'), as.Date('2010-11-04') ,1)
> dd[ duplicated(dd) ]
character(0)
已将报告发送至:
> maintainer('xts')
[1] "Jeffrey A. Ryan <jeff.a.ryan@gmail.com>"