'numeric timestamp for timeseries forecast in R

While doing an arima forecast on a timeseries, i would like to display the obtained fitted values along with the respective dates. Therefore i have entered the following code:

gyno_ts <- ts(gyno_train[, 7], start = c(2002, 4), end=c(2020, 8), frequency=52)
fitarima7 <- Arima(gyno_ts, order=c(0,1,3), seasonal=c(0,1,1))
pf<-forecast(fitarima7,h=50)
print(pf)

and i obtain the following:

Point Forecast    Lo 80    Hi 80    Lo 95    Hi 95
2020.154       70.89539 67.55975 74.23104 65.79396 75.99682
2020.173       70.65575 67.20593 74.10558 65.37970 75.93180
2020.192       70.11967 66.60078 73.63856 64.73800 75.50134
2020.212       70.39745 66.81806 73.97684 64.92325 75.87165
2020.231       69.73078 66.09190 73.36967 64.16559 75.29598
2020.250       70.61967 66.92225 74.31710 64.96496 76.27439
2020.269       70.17523 66.42018 73.93028 64.43238 75.91808
2020.288       70.61968 66.80788 74.43148 64.79003 76.44933
2020.308       69.84190 65.97418 73.70963 63.92673 75.75708
2020.327       69.00857 65.08572 72.93142 63.00909 75.00805
2020.346       70.84191 66.86470 74.81912 64.75929 76.92452
2020.365       71.28635 67.25552 75.31719 65.12172 77.45099
2020.385       70.56414 66.48037 74.64790 64.31856 76.80971
2020.404       70.00858 65.87258 74.14459 63.68311 76.33406
2020.423       70.17525 65.98765 74.36285 63.77087 76.57964
2020.442       69.17526 64.93669 73.41382 62.69292 75.65759
2020.462       71.28637 66.99744 75.57530 64.72702 77.84572
2020.481       71.34193 67.00322 75.68063 64.70645 77.97741
2020.500       71.56415 67.17624 75.95207 64.85341 78.27489
2020.519       71.06416 66.62757 75.50074 64.27899 77.84933
2020.538       70.67527 66.19055 75.15999 63.81648 77.53406
2020.558       70.61972 66.08737 75.15207 63.68809 77.55135
2020.577       71.11973 66.54025 75.69921 64.11602 78.12343
2020.596       70.45306 65.82693 75.07919 63.37801 77.52812
2020.615       70.34196 65.66964 75.01427 63.19627 77.48765
2020.635       69.84196 65.12391 74.56001 62.62633 77.05760
2020.654       70.28641 65.52307 75.04975 63.00151 77.57132
2020.673       69.89753 65.08932 74.70574 62.54400 77.25105
2020.692       70.00864 65.15598 74.86131 62.58713 77.43015
2020.712       70.84198 65.94527 75.73869 63.35311 78.33086
2020.731       70.78643 65.84606 75.72680 63.23079 78.34208
2020.750       70.23088 65.24724 75.21453 62.60906 77.85271
2020.769       71.06422 66.03768 76.09077 63.37678 78.75166
2020.788       70.11978 65.05070 75.18887 62.36729 77.87228
2020.808       69.56423 64.45296 74.67550 61.74722 77.38124
2020.827       70.67535 65.52224 75.82846 62.79435 78.55635

my question is how to convert the numeric format 2020.827 to a date-format ? is there a way to add a tooltip on a plot on the forecast points ?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source