library(tidyverse)
library(tidyquant)
library(timetk)
# 30-min interval data
taylor_30_min %>%
future_frame(date, .length_out = "1 week")
# Daily Data (Grouped)
m4_daily %>%
group_by(id) %>%
future_frame(date, .length_out = "6 weeks")
# Specify how many observations to project into the future
m4_daily %>%
group_by(id) %>%
future_frame(date, .length_out = 100)
# Bind with Original Data
m4_daily %>%
group_by(id) %>%
future_frame(date, .length_out = 100, .bind_data = TRUE)
holidays <- tk_make_holiday_sequence(
start_date = "2017-01-01",
end_date = "2017-12-31",
calendar = "NYSE")
weekends <- tk_make_weekend_sequence(
start_date = "2017-01-01",
end_date = "2017-12-31"
)
FANG %>%
group_by(symbol) %>%
future_frame(
.length_out = "1 year",
.skip_values = c(holidays, weekends)
)
Run the code above in your browser using DataLab