Tsibble dealing with fill gaps

Hi guys I have to fill my data to regular time series, but when I transform my tibble to a tsibble data and do na_interpolation my data return to a tibble format:

iniciativa_tsbl <- as_tsibble(iniciativa,
key = c(tipo_demanda),
index = data_planejada) %>%
fill_gaps(n, .full = TRUE)

what the best approach to deal with an issue like this?
I retransformed the data in a tsibble again and i could not plot my timeseries with the following error:
Erro: There are no variables to plot.

Best Regards
Lucas Zago

Please provide a reproducible example of the problem. The following code tries to do something like what I think you've done and it works.


iniciativa <- tibble(
  tipo_demanda = rep(c("A","B"), 10),
  data_planejada = sample(seq(as.Date("2020-01-01"), length=20, by="1 day"), size=20),
  value = sample(seq(100), size=20)
iniciativa_tsbl <- as_tsibble(iniciativa,
    key = c(tipo_demanda),
    index = data_planejada
  ) %>%
  fill_gaps(.full = TRUE)

iniciativa_tsbl %>% 
  autoplot(value) +
#> Warning: Removed 2 row(s) containing missing values (geom_path).
#> Warning: Removed 20 rows containing missing values (geom_point).

Created on 2020-11-04 by the reprex package (v0.3.0)

This solve my problem, thanks for replying asap.
Actually the variable tipo_demanda, i was trying to use as a predictor for my forecast.
Could you inform if there is some references how to use predictors such as size of delivery, new product in some place?
I would appreciate your references ,


See OTexts.com/fpp3, especially chapters 7 and 10.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.