0

the data i have is separated by three days each, i have successfully converted the dates so that i can convert it to an xts format but most forecast functions are unavailable on it, hence i need to convert to a time series.

> my.dates <- as.Date(my[,1])
> Be<- xts(my[,-1], order.by=my.dates)
> Be
output:
          Bangalore.East Bangalore.West Bangalore.South RR.nagar Bommanhalli
2020-05-11              6             37               5        0          36
2020-05-14              6             42               5        1          35
2020-05-17             31             38               4        1          22
2020-05-20             47             41               4        1          25
2020-05-23             46             46               5        1          21
2020-05-26             46             37               4        1          20
2020-05-29             39             30               4        0          23
2020-06-02             29             28               6        0          15
2020-06-05             23             23               5        0          10
2020-06-08             16             24               8        0          14
2020-06-11             39             39              36        0          20
2020-06-14             48             43              44        0          27
2020-06-17             67             39              80        4          33
2020-06-20             68             39              97       11          41
2020-06-23             93             94             154       33          68
2020-06-26            262            186             327       64         101
2020-06-29            428            371             663      128         186
2020-07-02           1420           1220            1823      391         507
2020-07-05           1694           1650            2313      322         630
2020-07-08           1932           1962            2703      769         607
           Mahadevapura Yehlanka Dasarhalli Rest.of.Bangalore.Urban
2020-05-11            1        1          0                       1
2020-05-14            1        1          0                       1
2020-05-17            1        1          0                       1
2020-05-20            2        1          0                       1
2020-05-23            4        2          0                       1
2020-05-26            6        2          0                       1
2020-05-29            8        2          0                       1
2020-06-02            8        1          1                       3
2020-06-05            8        2          1                       1
2020-06-08           10        4          3                       3
2020-06-11           14        5          5                       4
2020-06-14           13        7          5                      13
2020-06-17           21       11          5                      14
2020-06-20           26       15          9                       9
2020-06-23           39       21          9                       9
2020-06-26           62       27         14                      42
2020-06-29          113       47         26                      97
2020-07-02          364      225         60                     155
2020-07-05          499      310         65                     258
2020-07-08          566      362        126                     570
           Outside.Bangalore.Urban
2020-05-11                       1
2020-05-14                       1
2020-05-17                       1
2020-05-20                       2
2020-05-23                       1
2020-05-26                       1
2020-05-29                       1
2020-06-02                       1
2020-06-05                       4
2020-06-08                       6
2020-06-11                      12
2020-06-14                      15
2020-06-17                      12
2020-06-20                      22
2020-06-23                      42
2020-06-26                      47
2020-06-29                      76
2020-07-02                     310
2020-07-05                     344
2020-07-08                     403

i need to convert this to a timeseries so i can forecast upto 9 days.

  • 2
    Just a comment on how to share your example data. Try the command ```dput()``` – bttomio Jul 16 '20 at 12:19
  • 1
    Hello :) what kind of errors are you facing? Please consider this post about [how to make great R reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). Have you checked the properties of objects used by `forecast` functions? They are many ways to deal with time series in R so we need more details to help you. – Paul Jul 16 '20 at 12:40

1 Answers1

0

You could try this, considering the column Bangalore.East:

ts(Be$Bangalore.East)

You need to extract each time series individually.

bttomio
  • 2,206
  • 1
  • 6
  • 17