为了在RI中设置每小时的时间序列,我们遇到了以下情况.
time_index <- seq(from = as.POSIXct("2015-01-01 00:00"),
to = as.POSIXct("2015-03-31 23:00"), by = "hour")
len(time_index)
[1] 2159
Run Code Online (Sandbox Code Playgroud)
从2015年1月1日到3月底,有31 + 28 + 31 = 90天.所以我期望seq返回一个长度为24*90 = 2160的序列,但它似乎是一个短数字.经过一番调查后我注意到了
time_index[1+66*24+1]
[1] "2015-03-08 01:00:00 EST"
time_index[1+66*24+2]
[1] "2015-03-08 03:00:00 EDT"
Run Code Online (Sandbox Code Playgroud)
3月8日错过了一个小时.seq()在这里发生了什么?我犯了一个我错过的简单错误吗?