Closed robjhyndman closed 5 years ago
library(tsibble) library(dplyr) library(lubridate) library(fable) goog2015 <- tsibbledata::gafa_stock %>% filter(Symbol == "GOOG") %>% mutate(day = row_number()) %>% update_tsibble(index = day, regular = TRUE) %>% filter(year(Date) == 2015) goog2015_tr <- goog2015 %>% slice(1:(n()-8)) %>% stretch_tsibble(.init = 3, .step = 1) fc <- goog2015_tr %>% model(RW(Close ~ drift())) %>% forecast(h=8) %>% group_by(.id) %>% mutate(h = row_number()) %>% ungroup() #> Quosures can only be unquoted within a quasiquotation context. #> #> # Bad: #> list(!!myquosure) #> #> # Good: #> dplyr::mutate(data, !!myquosure)
Created on 2019-07-18 by the reprex package (v0.3.0)
Created on 2019-07-18 by the reprex package (v0.3.0)