Can anyone tell me why I do have only 1895 elements instead of 1896(79 days X 24 hours)?
time_index <- seq(from = as.POSIXct("2017-01-02 01:00"),
to = as.POSIXct("2017-03-21 24:00"), by = "hour")
length(time_index)
# >[1] 1895
daylight saving ?
time_index[1655:1660]
[1] "2017-03-11 23:00:00 EST" "2017-03-12 00:00:00 EST"
[3] "2017-03-12 01:00:00 EST" "2017-03-12 03:00:00 EDT"
[5] "2017-03-12 04:00:00 EDT" "2017-03-12 05:00:00 EDT"
to stop it from happening one must choose a time zone where there is no daylight saving, here is an example
time_index <- seq(from = as.POSIXct("2017-01-02 01:00",tz = 'UTC'),
to = as.POSIXct("2017-03-21 24:00", tz = 'UTC'),
by = "hour")
length(time_index)
[1] 1896
3