尽管夏令时 R 降低时间序列的频率并保持一天中的同一小时

Lowering the frequency of a time series and holding same hour of the day in despite of summer time R

我正在尝试从 5 分钟间隔改为 4 小时间隔。 POSIXctzoo/xts 对象工作正常。但是,自夏季或冬季以来,我一直无法为每天的同一时间创建 4 小时间隔,尽管正确,但请更改我的索引。

这是我试过的:

Sys.setenv(TZ="Europe/Paris") # to reproduce example
ts1 <- seq(as.POSIXct("2014-10-25 00:00:00"), as.POSIXct("2014-10-26 23:00:00"), by='5 min')

library(zoo)
x <- zoo(rnorm(length(ts1)), ts1)
# to construct an irregular time series
interval <- "4 hour" 

ini <- min(index(x))
fin <- max(index(x))
tseq <- seq(ini, fin, by = interval); tseq

这就是 summer/winter 时间对常规 4 小时间隔的作用。尝试使用没有夏令时的时区,例如

Sys.setenv(TZ="UTC")