按时间序列图保留日期(posixct)

时间:2018-03-12 16:52:34

标签: r plot time-series posixct

问题在于,当我运行ts()时,以posixct格式的日期(Mean_Individual_data $ Date)将转换为整数,如图所示,通过以下链接。有没有办法在通过ts()后保留x轴的日期时间格式?

我一直在尝试很多方法,但似乎无法找到解决方法。因此,非常感谢任何帮助或替代解决方案。

数据:https://www.dropbox.com/s/9lf2nc74y67uscd/Mean_Individual_data.csv?dl=0

Mean_Individual_data
         Date_Timeframe         x
1   2098-02-09 09:00:00 20.000000
2   2098-02-10 09:00:00 24.100000
3   2098-02-11 09:00:00 27.900000
4   2098-02-12 09:00:00 28.400000
5   2098-02-12 15:00:00 24.450000
6   2098-02-12 21:00:00 15.800000
7   2098-02-13 09:00:00 16.450000
8   2098-02-13 21:00:00 15.050000
9   2098-02-14 03:00:00 22.700000
10  2098-02-14 09:00:00 14.200000

MA_Individual = ts(Mean_Individual_data$Mean.Result.Value, frequency=60)
fit<-auto.arima(MA_Individual, seasonal=TRUE)
fcast <- forecast(fit, h=20)
plot(fcast, type="o", pch=16, cex=0.65, xlab="Date", ylab="Blood Glucose (mmol/L)", main = "Quart-Hourly BG")
abline(h=4, col="red", lty=2)

结果图:

enter image description here

0 个答案:

没有答案