如何在 Rbeast 算法生成的图形的 x 轴上显示日期 (YYYY-MM-DD)?

How to display Dates (YYYY-MM-DD) on the x-axis of the graph resulting from the Rbeast algorithm?

提问人:Liz Arsenault 提问时间:11/9/2023 最后编辑:Jilber UrbinaLiz Arsenault 更新时间:11/9/2023 访问量:38

问:

我正在使用 Rbeast 算法(Zhao 等人,2019 年)来识别 128 天每日水文气象系列中的制度中断。在图形输出中,x 轴显示时间序列中的天数(例如 0 到 128),或标量刻度中的日期(例如 2021.90 到 2022.25)。我真的希望日期以“YYYY-MM-DD”格式显示在 x 轴上。我怎样才能做到这一点?

目前,我尝试输入时间序列的开头(start = as。Date(2021-11-24)),数据(deltat = “1day”)和周期(period = “128 days”)之间的间隔。

out_Q <- beast(y = Q_All$X75e_percentile,
              start = as.Date('2021-11-24'), #commence quand
              deltat = "1day", #intervalle de temps entre 2 données ici 1 jour
              period = '128 days',
              season = 'none',
              quiet = TRUE)
plot.beast(out_Q,
           vars = c("t", "slpsgn"),
           ylab = c("Trend and breaking points", "Trend slope"),
           main = "",
           xlab = "Time",
           col = "red",
           ncpStat = "mean",
           xaxp = c(as.Date('2021-11-24'),as.Date('2022-03-31')))

结果如下:Scalat 日期

enter image description here

我还试图消除这些论点,从而获得了日期数字。

结果如下:Number of the day in time serie

enter image description here

R 时间序列

评论


答: 暂无答案