从评论中,时间以某种 MDJ 秒为单位,因此您可以使用 Gabor 的提示将其转换为时间索引:
library(zoo)
z <- read.zoo("myfile.dat", sep = ",",
FUN = function(x){as.POSIXct(x,origin='1858-11-17',tz='UTC')})
其中 1858-11-17 是每个http://en.wikipedia.org/wiki/Julian_day的 MJD 时代
或者,您可以指定原点并添加秒数 - 因为:
z <- read.zoo("myfile.dat", sep = ",",
FUN = function(x){as.POSIXct('1858-11-17',tz='UTC')+x})
那么您似乎想要及时按各种粒度聚合的数据:
plot(aggregate(z,cut(time(z),breaks='year' ),mean))
plot(aggregate(z,cut(time(z),breaks='quarter'),mean))
plot(aggregate(z,cut(time(z),breaks='month' ),mean))
plot(aggregate(z,cut(time(z),breaks='day' ),mean))
plot(aggregate(z,cut(time(z),breaks='hour' ),mean))
plot(aggregate(z,cut(time(z),breaks='6 min' ),mean))
plot(aggregate(z,cut(time(z),breaks='min' ),mean))
plot(aggregate(z,cut(time(z),breaks='10 sec' ),mean))
plot(aggregate(z,cut(time(z),breaks='sec' ),mean))