library(dplyr)
library(lubridate)
library(zoo)
# Works with time-based tibbles
FB_tbl <- FANG %>% dplyr::filter(symbol == "FB")
FB_idx <- tk_index(FB_tbl)
tk_get_timeseries_signature(FB_idx)
tk_get_timeseries_summary(FB_idx)
# Works with dates in any periodicity
idx_weekly <- seq.Date(from = lubridate::ymd("2016-01-01"), by = 'week', length.out = 6)
tk_get_timeseries_signature(idx_weekly)
tk_get_timeseries_summary(idx_weekly)
# Works with zoo yearmon and yearqtr classes
idx_yearmon <- seq.Date(from = lubridate::ymd("2016-01-01"),
by = "month",
length.out = 12) %>%
zoo::as.yearmon()
tk_get_timeseries_signature(idx_yearmon)
tk_get_timeseries_summary(idx_yearmon)
Run the code above in your browser using DataLab