diff --git a/.DS_Store b/.DS_Store
deleted file mode 100644
index fd78c758..00000000
Binary files a/.DS_Store and /dev/null differ
diff --git a/.Rbuildignore b/.Rbuildignore
index 1aba03a4..89155c2e 100644
--- a/.Rbuildignore
+++ b/.Rbuildignore
@@ -3,7 +3,6 @@
^data-raw$
^README\.Rmd$
^README-.*\.png$
-^\.travis\.yml$
^cran-comments\.md$
^revdep$
img
diff --git a/.gitignore b/.gitignore
index 482c71e3..9d4c9225 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,3 +9,4 @@ Meta
docs
/doc/
/Meta/
+docs/
diff --git a/DESCRIPTION b/DESCRIPTION
index 29ca554b..562ec537 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,7 +1,7 @@
Package: timetk
Type: Package
Title: A Tool Kit for Working with Time Series
-Version: 2.8.4
+Version: 2.8.4.9000
Authors@R: c(
person("Matt", "Dancho", email = "mdancho@business-science.io", role = c("aut", "cre")),
person("Davis", "Vaughan", email = "dvaughan@business-science.io", role = c("aut"))
@@ -43,15 +43,13 @@ Imports:
forecast,
tsfeatures,
hms,
- generics,
- tidymodels
+ generics
Suggests:
modeltime,
glmnet,
workflows,
parsnip,
- tune,
- yardstick,
+ tune (>= 0.1.2),
knitr,
rmarkdown,
broom,
diff --git a/NEWS.md b/NEWS.md
index ce849849..f6699ee2 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,3 +1,8 @@
+# timetk (development version)
+
+- Removed dependency on tidymodels. (#154, @olivroy).
+
+
# timetk 2.8.4
Update forecasting vignette: Use `glmnet` for time series forecasting.
diff --git a/R/augment-tk_augment_differences.R b/R/augment-tk_augment_differences.R
index 1c8b2870..35a2c0ff 100644
--- a/R/augment-tk_augment_differences.R
+++ b/R/augment-tk_augment_differences.R
@@ -43,7 +43,6 @@
#'
#' @examples
#' library(dplyr)
-#' library(timetk)
#'
#' m4_monthly %>%
#' group_by(id) %>%
diff --git a/R/augment-tk_augment_fourier.R b/R/augment-tk_augment_fourier.R
index 7d92f94d..b0955a99 100644
--- a/R/augment-tk_augment_fourier.R
+++ b/R/augment-tk_augment_fourier.R
@@ -41,7 +41,6 @@
#'
#' @examples
#' library(dplyr)
-#' library(timetk)
#'
#' m4_monthly %>%
#' group_by(id) %>%
@@ -65,7 +64,7 @@ tk_augment_fourier <- function(.data,
# if (rlang::is_missing(.K)) stop(call. = FALSE, "tk_augment_fourier(.K) is missing.")
if (!any(.names == "auto")) {
if (length(.names) != length(.periods) * 2) {
- rlang::abort(".names must be a vector of length ", length(.periods) * 2)
+ rlang::abort(c(".names must be a vector of length ", length(.periods) * 2))
}
}
vals <- .data %>% dplyr::pull(!! rlang::enquo(.date_var))
diff --git a/R/augment-tk_augment_holiday_signature.R b/R/augment-tk_augment_holiday_signature.R
index bc545022..b207266e 100644
--- a/R/augment-tk_augment_holiday_signature.R
+++ b/R/augment-tk_augment_holiday_signature.R
@@ -55,7 +55,6 @@
#'
#' @examples
#' library(dplyr)
-#' library(timetk)
#'
#' dates_in_2017_tbl <- tibble(index = tk_make_timeseries("2017-01-01", "2017-12-31", by = "day"))
#'
@@ -137,11 +136,10 @@ tk_augment_holiday_signature.data.frame <- function(.data,
# .data <- .data %>% dplyr::arrange(!! sym(date_var))
# Bind Time Series Signature
- ret_1 <- .data %>% dplyr::ungroup()
+ ret_1 <- dplyr::ungroup(.data)
- ret_2 <- .data %>%
- dplyr::ungroup() %>%
- dplyr::pull(date_var) %>%
+ ret_2 <- ret_1 %>%
+ dplyr::pull(dplyr::all_of(date_var)) %>%
tk_get_holiday_signature(
holiday_pattern = .holiday_pattern,
locale_set = .locale_set,
diff --git a/R/augment-tk_augment_lags.R b/R/augment-tk_augment_lags.R
index 71212bed..40984ca3 100644
--- a/R/augment-tk_augment_lags.R
+++ b/R/augment-tk_augment_lags.R
@@ -46,7 +46,6 @@
#'
#' @examples
#' library(dplyr)
-#' library(timetk)
#'
#' # Lags
#' m4_monthly %>%
diff --git a/R/augment-tk_augment_slidify.R b/R/augment-tk_augment_slidify.R
index 1d54781e..00f35a61 100644
--- a/R/augment-tk_augment_slidify.R
+++ b/R/augment-tk_augment_slidify.R
@@ -42,8 +42,6 @@
#'
#' @examples
#' library(dplyr)
-#' library(stringr)
-#' library(timetk)
#'
#' # Single Column | Multiple Rolling Windows
#' FANG %>%
@@ -55,7 +53,7 @@
#' .period = c(10, 30, 60, 90),
#' .f = mean,
#' .partial = TRUE,
-#' .names = str_c("MA_", c(10, 30, 60, 90))
+#' .names = stringr::str_c("MA_", c(10, 30, 60, 90))
#' ) %>%
#' ungroup()
#'
@@ -184,7 +182,7 @@ tk_augment_slidify.grouped_df <- function(.data,
.names = .names
)
)) %>%
- dplyr::select(-data) %>%
+ dplyr::select(-"data") %>%
tidyr::unnest(cols = nested.col) %>%
dplyr::group_by_at(.vars = group_names)
}
diff --git a/R/augment-tk_augment_timeseries.R b/R/augment-tk_augment_timeseries.R
index 33622f95..782d9861 100644
--- a/R/augment-tk_augment_timeseries.R
+++ b/R/augment-tk_augment_timeseries.R
@@ -32,7 +32,6 @@
#'
#' @examples
#' library(dplyr)
-#' library(timetk)
#'
#' m4_daily %>%
#' group_by(id) %>%
@@ -109,7 +108,7 @@ tk_augment_timeseries_signature.grouped_df <- function(.data, .date_var = NULL)
.date_var = NULL
)
)) %>%
- dplyr::select(-data) %>%
+ dplyr::select(-"data") %>%
tidyr::unnest(cols = nested.col) %>%
dplyr::group_by_at(.vars = group_names)
} else {
@@ -122,7 +121,7 @@ tk_augment_timeseries_signature.grouped_df <- function(.data, .date_var = NULL)
.date_var = !! date_var_expr
)
)) %>%
- dplyr::select(-data) %>%
+ dplyr::select(-"data") %>%
tidyr::unnest(cols = nested.col) %>%
dplyr::group_by_at(.vars = group_names)
}
diff --git a/R/coersion-tk_tbl.R b/R/coersion-tk_tbl.R
index 7b59a74f..95f47386 100644
--- a/R/coersion-tk_tbl.R
+++ b/R/coersion-tk_tbl.R
@@ -31,9 +31,7 @@
#' @seealso [tk_xts()], [tk_zoo()], [tk_zooreg()], [tk_ts()]
#'
#' @examples
-#' library(tibble)
#' library(dplyr)
-#' library(timetk)
#'
#' data_tbl <- tibble(
#' date = seq.Date(from = as.Date("2010-01-01"), by = 1, length.out = 5),
@@ -85,7 +83,6 @@
#'
#'
#'
-#'
#' @export
tk_tbl <- function(data, preserve_index = TRUE, rename_index = "index", timetk_idx = FALSE, silent = FALSE, ...) {
UseMethod("tk_tbl", data)
diff --git a/R/coersion-tk_ts.R b/R/coersion-tk_ts.R
index bc06c347..c1e2017d 100644
--- a/R/coersion-tk_ts.R
+++ b/R/coersion-tk_ts.R
@@ -31,9 +31,7 @@
#' @seealso [tk_index()], [tk_tbl()], [tk_xts()], [tk_zoo()], [tk_zooreg()]
#'
#' @examples
-#' library(tibble)
#' library(dplyr)
-#' library(timetk)
#'
#' ### tibble to ts: Comparison between tk_ts() and stats::ts()
#' data_tbl <- tibble::tibble(
diff --git a/R/coersion-tk_xts.R b/R/coersion-tk_xts.R
index edf6e765..a75ecd40 100644
--- a/R/coersion-tk_xts.R
+++ b/R/coersion-tk_xts.R
@@ -38,9 +38,7 @@
#' @seealso [tk_tbl()], [tk_zoo()], [tk_zooreg()], [tk_ts()]
#'
#' @examples
-#' library(tibble)
#' library(dplyr)
-#' library(timetk)
#'
#' ### tibble to xts: Comparison between tk_xts() and xts::xts()
#' data_tbl <- tibble::tibble(
@@ -69,7 +67,6 @@
#' select <- "y"
#' tk_xts_(data_tbl, select = select, date_var = date_var)
#'
-#' @name tk_xts
#' @export
tk_xts <- function(data, select = NULL, date_var = NULL, silent = FALSE, ...) {
select <- rlang::quo_name(rlang::enquo(select))
diff --git a/R/coersion-tk_zoo.R b/R/coersion-tk_zoo.R
index 2ca4394c..5f32269a 100644
--- a/R/coersion-tk_zoo.R
+++ b/R/coersion-tk_zoo.R
@@ -40,12 +40,10 @@
#' @seealso [tk_tbl()], [tk_xts()], [tk_zooreg()], [tk_ts()]
#'
#' @examples
-#' library(tibble)
#' library(dplyr)
-#' library(timetk)
#'
#' ### tibble to zoo: Comparison between tk_zoo() and zoo::zoo()
-#' data_tbl <- tibble::tibble(
+#' data_tbl <- dplyr::tibble(
#' date = seq.Date(as.Date("2016-01-01"), by = 1, length.out = 5),
#' x = rep("chr values", 5),
#' y = cumsum(1:5),
diff --git a/R/diagnostics-tk_acf_diagnostics.R b/R/diagnostics-tk_acf_diagnostics.R
index 7902485b..145c5050 100644
--- a/R/diagnostics-tk_acf_diagnostics.R
+++ b/R/diagnostics-tk_acf_diagnostics.R
@@ -61,7 +61,6 @@
#'
#' @examples
#' library(dplyr)
-#' library(timetk)
#'
#' # ACF, PACF, & CCF in 1 Data Frame
#' # - Get ACF & PACF for target (adjusted)
@@ -139,7 +138,7 @@ tk_acf_diagnostics.data.frame <- function(.data, .date_var, .value, .ccf_vars =
# Calcs
.lags <- sort(.lags)
- x <- .data %>% dplyr::pull(.value_mod)
+ x <- .data %>% dplyr::pull(".value_mod")
lag_max <- max(.lags)
lag_min <- min(.lags)
@@ -239,7 +238,7 @@ tk_acf_diagnostics.grouped_df <- function(.data, .date_var, .value, .ccf_vars =
.lags = .lags
)
)) %>%
- dplyr::select(-data) %>%
+ dplyr::select(-"data") %>%
tidyr::unnest(cols = nested.col) %>%
dplyr::group_by_at(.vars = group_names)
diff --git a/R/diagnostics-tk_anomaly_diagnostics.R b/R/diagnostics-tk_anomaly_diagnostics.R
index 034f398a..53f28faf 100644
--- a/R/diagnostics-tk_anomaly_diagnostics.R
+++ b/R/diagnostics-tk_anomaly_diagnostics.R
@@ -78,7 +78,6 @@
#'
#' @examples
#' library(dplyr)
-#' library(timetk)
#'
#' walmart_sales_weekly %>%
#' filter(id %in% c("1_1", "1_3")) %>%
@@ -178,7 +177,7 @@ tk_anomaly_diagnostics.grouped_df <- function(.data, .date_var, .value,
.message = .message
)
)) %>%
- dplyr::select(-data) %>%
+ dplyr::select(-"data") %>%
tidyr::unnest(cols = nested.col) %>%
dplyr::group_by_at(.vars = group_names)
@@ -294,15 +293,15 @@ iqr_vec <- function(x, alpha = 0.05, max_anoms = 0.2, verbose = FALSE) {
# Return results
if (verbose) {
outlier_list <- list(
- outlier = vals_tbl %>% dplyr::arrange(index) %>% dplyr::pull(outlier_reported),
- outlier_idx = vals_tbl %>% dplyr::filter(outlier_reported == "Yes") %>% dplyr::pull(index),
- outlier_vals = vals_tbl %>% dplyr::filter(outlier_reported == "Yes") %>% dplyr::pull(value),
- outlier_direction = vals_tbl %>% dplyr::filter(outlier_reported == "Yes") %>% dplyr::pull(direction),
+ outlier = vals_tbl %>% dplyr::arrange(index) %>% dplyr::pull("outlier_reported"),
+ outlier_idx = vals_tbl %>% dplyr::filter(outlier_reported == "Yes") %>% dplyr::pull("index"),
+ outlier_vals = vals_tbl %>% dplyr::filter(outlier_reported == "Yes") %>% dplyr::pull("value"),
+ outlier_direction = vals_tbl %>% dplyr::filter(outlier_reported == "Yes") %>% dplyr::pull("direction"),
critical_limits = limits_vec,
outlier_report = vals_tbl_filtered
)
return(outlier_list)
} else {
- return(vals_tbl %>% dplyr::arrange(index) %>% dplyr::pull(outlier_reported))
+ return(vals_tbl %>% dplyr::arrange(index) %>% dplyr::pull("outlier_reported"))
}
}
diff --git a/R/diagnostics-tk_seasonal_diagnostics.R b/R/diagnostics-tk_seasonal_diagnostics.R
index 803acb10..cf6139fd 100644
--- a/R/diagnostics-tk_seasonal_diagnostics.R
+++ b/R/diagnostics-tk_seasonal_diagnostics.R
@@ -48,7 +48,6 @@
#' @examples
#' \donttest{
#' library(dplyr)
-#' library(timetk)
#'
#' # ---- GROUPED EXAMPLES ----
#'
@@ -170,7 +169,7 @@ tk_seasonal_diagnostics.grouped_df <- function(.data, .date_var, .value, .featur
.feature_set = .feature_set
)
)) %>%
- dplyr::select(-data) %>%
+ dplyr::select(-"data") %>%
tidyr::unnest(cols = nested.col) %>%
dplyr::group_by_at(.vars = group_names)
@@ -194,7 +193,7 @@ get_seasonal_auto_features <- function(.index) {
dplyr::mutate(check = value %>% dplyr::between(max_min_list$min_period$value, max_min_list$max_period$value)) %>%
dplyr::filter(check) %>%
dplyr::left_join(time_series_signature_lookup_tbl(), by = "key") %>%
- dplyr::pull(feature)
+ dplyr::pull("feature")
return(features_to_get)
}
@@ -219,7 +218,7 @@ get_max_min_list <- function(time_series_summary_tbl) {
tidyr::gather() %>%
dplyr::mutate(check = 2 * value < start_to_end) %>%
dplyr::filter(check) %>%
- dplyr::slice(dplyr::n())
+ dplyr::slice_tail(n = 1)
# Max and min
max_min_list <- list(min_period = min_period, max_period = max_period)
diff --git a/R/diagnostics-tk_stl_diagnostics.R b/R/diagnostics-tk_stl_diagnostics.R
index ceb82fb7..5dafcbef 100644
--- a/R/diagnostics-tk_stl_diagnostics.R
+++ b/R/diagnostics-tk_stl_diagnostics.R
@@ -47,7 +47,6 @@
#'
#' @examples
#' library(dplyr)
-#' library(timetk)
#'
#'
#' # ---- GROUPS & TRANSFORMATION ----
@@ -112,7 +111,7 @@ tk_stl_diagnostics.data.frame <- function(.data, .date_var, .value,
# STL Calculation
stl_obj <- data_formatted %>%
- dplyr::pull(.value_mod) %>%
+ dplyr::pull(".value_mod") %>%
stats::ts(frequency = freq) %>%
stats::stl(s.window = "periodic", t.window = trnd, robust = TRUE)
diff --git a/R/diagnostics-tk_summary_diagnostics.R b/R/diagnostics-tk_summary_diagnostics.R
index b7685b56..18290713 100644
--- a/R/diagnostics-tk_summary_diagnostics.R
+++ b/R/diagnostics-tk_summary_diagnostics.R
@@ -19,7 +19,6 @@
#'
#' @examples
#' library(dplyr)
-#' library(timetk)
#'
#' # ---- NON-GROUPED EXAMPLES ----
#'
diff --git a/R/diagnostiscs-tsfeatures.R b/R/diagnostiscs-tsfeatures.R
index 41498115..e6e85b13 100644
--- a/R/diagnostiscs-tsfeatures.R
+++ b/R/diagnostiscs-tsfeatures.R
@@ -71,7 +71,6 @@
#'
#' @examples
#' library(dplyr)
-#' library(timetk)
#'
#' walmart_sales_weekly %>%
#' group_by(id) %>%
diff --git a/R/dplyr-add_time.R b/R/dplyr-add_time.R
index e6751351..d0114670 100644
--- a/R/dplyr-add_time.R
+++ b/R/dplyr-add_time.R
@@ -36,7 +36,6 @@
#'
#'
#' @examples
-#' library(timetk)
#'
#'
#' # ---- LOCATING A DATE N-PERIODS IN FUTURE / PAST ----
@@ -67,7 +66,7 @@
#'
#'
#' @name time_arithmetic
-#' @export
+NULL
# ADD ----
diff --git a/R/dplyr-between_time.R b/R/dplyr-between_time.R
index ae0f378f..6b9d0e3b 100644
--- a/R/dplyr-between_time.R
+++ b/R/dplyr-between_time.R
@@ -65,7 +65,6 @@
#'
#' @examples
#' library(dplyr)
-#' library(timetk)
#'
#' index_daily <- tk_make_timeseries("2016-01-01", "2017-01-01", by = "day")
#' index_min <- tk_make_timeseries("2016-01-01", "2017-01-01", by = "min")
diff --git a/R/dplyr-condense_period.R b/R/dplyr-condense_period.R
index 9983bfca..ac67f7be 100644
--- a/R/dplyr-condense_period.R
+++ b/R/dplyr-condense_period.R
@@ -54,7 +54,6 @@
#'
#' @examples
#' # Libraries
-#' library(timetk)
#' library(dplyr)
#'
#' # First value in each month
diff --git a/R/dplyr-filter_by_time.R b/R/dplyr-filter_by_time.R
index 66793312..0cfab440 100644
--- a/R/dplyr-filter_by_time.R
+++ b/R/dplyr-filter_by_time.R
@@ -65,7 +65,6 @@
#'
#' @examples
#' library(dplyr)
-#' library(timetk)
#'
#' # Filter values in January 1st through end of February, 2013
#' FANG %>%
diff --git a/R/dplyr-filter_period.R b/R/dplyr-filter_period.R
index d5b76759..e9f3ef14 100644
--- a/R/dplyr-filter_period.R
+++ b/R/dplyr-filter_period.R
@@ -58,7 +58,6 @@
#'
#' @examples
#' # Libraries
-#' library(timetk)
#' library(dplyr)
#'
#' # Max value in each month
diff --git a/R/dplyr-future_frame.R b/R/dplyr-future_frame.R
index f800133f..3c29b027 100644
--- a/R/dplyr-future_frame.R
+++ b/R/dplyr-future_frame.R
@@ -89,7 +89,6 @@
#' @examples
#' \donttest{
#' library(dplyr)
-#' library(timetk)
#'
#' # 30-min interval data
#' taylor_30_min %>%
diff --git a/R/dplyr-mutate_by_time.R b/R/dplyr-mutate_by_time.R
index 111b2ed4..815bc79d 100644
--- a/R/dplyr-mutate_by_time.R
+++ b/R/dplyr-mutate_by_time.R
@@ -60,9 +60,7 @@
#'
#' @examples
#' # Libraries
-#' library(timetk)
#' library(dplyr)
-#' library(tidyr)
#'
#' # First value in each month
#' m4_daily_first_by_month_tbl <- m4_daily %>%
@@ -77,7 +75,7 @@
#'
#' # Visualize Time Series vs 1st Value Each Month
#' m4_daily_first_by_month_tbl %>%
-#' pivot_longer(value:first_value_by_month) %>%
+#' tidyr::pivot_longer(value:first_value_by_month) %>%
#' plot_time_series(date, value, name,
#' .facet_scale = "free", .facet_ncol = 2,
#' .smooth = FALSE, .interactive = FALSE)
diff --git a/R/dplyr-pad_by_time.R b/R/dplyr-pad_by_time.R
index 09d7ae02..b1d9dd99 100644
--- a/R/dplyr-pad_by_time.R
+++ b/R/dplyr-pad_by_time.R
@@ -68,12 +68,10 @@
#' - This function wraps the `padr::pad()` function developed by Edwin Thoen.
#'
#' @examples
-#' library(tibble)
#' library(dplyr)
-#' library(timetk)
#'
#' # Create a quarterly series with 1 missing value
-#' missing_data_tbl <- tibble(
+#' missing_data_tbl <- tibble::tibble(
#' date = tk_make_timeseries("2014-01-01", "2015-01-01", by = "quarter"),
#' value = 1:5
#' ) %>%
diff --git a/R/dplyr-slice_period.R b/R/dplyr-slice_period.R
index 726b5dd2..8b89ac21 100644
--- a/R/dplyr-slice_period.R
+++ b/R/dplyr-slice_period.R
@@ -48,7 +48,6 @@
#'
#' @examples
#' # Libraries
-#' library(timetk)
#' library(dplyr)
#'
#' # First 5 observations in each month
diff --git a/R/dplyr-slidify.R b/R/dplyr-slidify.R
index ca5445ea..09566955 100644
--- a/R/dplyr-slidify.R
+++ b/R/dplyr-slidify.R
@@ -7,7 +7,7 @@
#' @param .period The period size to roll over
#' @param .align One of "center", "left" or "right".
#' @param .partial Should the moving window be allowed to return partial (incomplete) windows
-#' instead of `NA` values. Set to FALSE by default, but can be switched to TRUE to remove `NA`'s.
+#' instead of `NA` values. Set to `FALSE` by default, but can be switched to `TRUE` to remove `NA`'s.
#' @param .unlist If the function returns a single value each time it is called,
#' use `.unlist = TRUE`. If the function returns more than one value, or a more
#' complicated object (like a linear model), use `.unlist = FALSE` to create
@@ -75,11 +75,8 @@
#'
#' @examples
#' library(dplyr)
-#' library(tidyr)
-#' library(stringr)
-#' library(timetk)
#'
-#' FB <- FANG %>% filter(symbol == "FB")
+#' FB <- FANG %>% dplyr::filter(symbol == "FB")
#'
#'
#' # --- ROLLING MEAN (SINGLE ARG EXAMPLE) ---
@@ -115,14 +112,13 @@
#' select(symbol, date, adjusted) %>%
#' tk_augment_slidify(
#' adjusted, .period = 5:10, .f = mean, .align = "right",
-#' .names = str_c("MA_", 5:10)
+#' .names = stringr::str_c("MA_", 5:10)
#' )
#'
#' # --- GROUPS AND ROLLING ----
#'
#' # One of the most powerful things about this is that it works with
#' # groups since `mutate` is being used
-#' data(FANG)
#'
#' mean_roll_3 <- slidify(mean, .period = 3, .align = "right")
#'
@@ -176,7 +172,7 @@
#' lm_roll <- slidify(~lm(.x ~ .y), .period = 90, .unlist = FALSE, .align = "right")
#'
#' FB %>%
-#' drop_na() %>%
+#' tidyr::drop_na() %>%
#' mutate(numeric_date = as.numeric(date)) %>%
#' mutate(rolling_lm = lm_roll(adjusted, numeric_date)) %>%
#' filter(!is.na(rolling_lm))
@@ -185,7 +181,6 @@
#'
#'
#' @export
-#'
slidify <- function(.f, .period = 1,
.align = c("center", "left", "right"),
.partial = FALSE,
diff --git a/R/dplyr-summarise_by_time.R b/R/dplyr-summarise_by_time.R
index 8659f01c..e0fbbfb7 100644
--- a/R/dplyr-summarise_by_time.R
+++ b/R/dplyr-summarise_by_time.R
@@ -70,7 +70,6 @@
#'
#' @examples
#' # Libraries
-#' library(timetk)
#' library(dplyr)
#'
#' # First value in each month
diff --git a/R/get-tk_get_frequency.R b/R/get-tk_get_frequency.R
index aee0afb4..38399ada 100644
--- a/R/get-tk_get_frequency.R
+++ b/R/get-tk_get_frequency.R
@@ -61,7 +61,6 @@
#' @examples
#'
#' library(dplyr)
-#' library(timetk)
#'
#' idx_FB <- FANG %>%
#' filter(symbol == "FB") %>%
@@ -245,8 +244,8 @@ get_period_statistic <- function(idx, period = "1 day", fn = stats::median) {
ret <- data %>%
dplyr::mutate(index = lubridate::floor_date(index, unit = period)) %>%
dplyr::count(index) %>%
- dplyr::pull(n) %>%
- fn(na.rm = T)
+ dplyr::pull("n") %>%
+ fn(na.rm = TRUE)
return(ret)
diff --git a/R/get-tk_get_holiday_signature.R b/R/get-tk_get_holiday_signature.R
index 21b7bea9..6df8d4c1 100644
--- a/R/get-tk_get_holiday_signature.R
+++ b/R/get-tk_get_holiday_signature.R
@@ -42,7 +42,6 @@
#' @examples
#' library(dplyr)
#' library(stringr)
-#' library(timetk)
#'
#' # Works with time-based tibbles
#' idx <- tk_make_timeseries("2017-01-01", "2017-12-31", by = "day")
@@ -158,8 +157,8 @@ get_holiday_signature <- function(idx,
holiday_table <- tk_get_holidays_by_year(years)
# Separate into 2 sets
- holiday_table_locale <- holiday_table %>% dplyr::select(date, locale)
- holiday_table_name <- holiday_table %>% dplyr::select(date, holiday_name)
+ holiday_table_locale <- holiday_table %>% dplyr::select("date", "locale")
+ holiday_table_name <- holiday_table %>% dplyr::select("date", "holiday_name")
# 1. HOLIDAY FEATURES ----
@@ -186,8 +185,7 @@ get_holiday_signature <- function(idx,
dplyr::mutate(locale = stringr::str_c("locale_", locale)) %>%
dplyr::group_by(date, locale) %>%
- dplyr::summarize(value = min(value)) %>%
- dplyr::ungroup() %>%
+ dplyr::summarize(value = min(value), .groups = "drop") %>%
tidyr::pivot_wider(names_from = locale, values_from = value)
} else if (tolower(locale_set) == "all") {
# All selected - Just pivot
@@ -195,8 +193,7 @@ get_holiday_signature <- function(idx,
dplyr::mutate(value = 1) %>%
dplyr::mutate(locale = stringr::str_c("locale_", locale)) %>%
dplyr::group_by(date, locale) %>%
- dplyr::summarize(value = min(value)) %>%
- dplyr::ungroup() %>%
+ dplyr::summarize(value = min(value), .groups = "drop") %>%
tidyr::pivot_wider(names_from = locale, values_from = value)
} else {
# none selected - drop locale column
@@ -204,8 +201,7 @@ get_holiday_signature <- function(idx,
dplyr::select(-locale) %>%
dplyr::mutate(value = 1) %>%
dplyr::group_by(date) %>%
- dplyr::summarize(value = min(value)) %>%
- dplyr::ungroup()
+ dplyr::summarize(value = min(value), .groups = "drop")
holiday_table_locale[,"value"] <- NULL
}
@@ -230,13 +226,13 @@ get_holiday_signature <- function(idx,
if (any(tolower(exchange_set) %in% tolower(exchanges_needing_filtered))) {
# Not all or none - must have a locale selected
holiday_table_exchange <- holiday_table_exchange %>%
- dplyr::select(index, dplyr::contains(toupper(exchange_set)))
+ dplyr::select("index", dplyr::contains(toupper(exchange_set)))
} else if (tolower(exchange_set) == "all") {
# All selected - Nothing to do
} else {
# none selected - drop locale column
- holiday_table_exchange <- holiday_table_exchange %>% dplyr::select(index)
+ holiday_table_exchange <- holiday_table_exchange %>% dplyr::select("index")
}
# JOIN ALL TABLES
@@ -278,6 +274,6 @@ tk_get_holidays_by_year <- function(years = year(today())) {
dplyr::mutate(holiday_name = holidays %>% stringr::str_replace(pattern = locale, "")) %>%
dplyr::mutate(holiday_name = ifelse(is.na(holiday_name), holidays, holiday_name)) %>%
dplyr::mutate(holiday_name = stringr::str_c(locale, "_", holiday_name)) %>%
- dplyr::select(-holidays)
+ dplyr::select(-"holidays")
}
diff --git a/R/get-tk_get_timeseries.R b/R/get-tk_get_timeseries.R
index db8a25f0..9c3ed847 100644
--- a/R/get-tk_get_timeseries.R
+++ b/R/get-tk_get_timeseries.R
@@ -28,12 +28,11 @@
#'
#' @examples
#' library(dplyr)
-#' library(timetk)
#' library(lubridate)
#' library(zoo)
#'
#' # Works with time-based tibbles
-#' FB_tbl <- FANG %>% filter(symbol == "FB")
+#' FB_tbl <- FANG %>% dplyr::filter(symbol == "FB")
#' FB_idx <- tk_index(FB_tbl)
#'
#' tk_get_timeseries_signature(FB_idx)
@@ -41,14 +40,14 @@
#'
#'
#' # Works with dates in any periodicity
-#' idx_weekly <- seq.Date(from = ymd("2016-01-01"), by = 'week', length.out = 6)
+#' 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 = ymd("2016-01-01"),
+#' idx_yearmon <- seq.Date(from = lubridate::ymd("2016-01-01"),
#' by = "month",
#' length.out = 12) %>%
#' zoo::as.yearmon()
diff --git a/R/index-tk_index.R b/R/index-tk_index.R
index b196ca64..9ff516bf 100644
--- a/R/index-tk_index.R
+++ b/R/index-tk_index.R
@@ -46,7 +46,6 @@
#' @seealso [tk_ts()], [tk_tbl()], [tk_xts()], [tk_zoo()], [tk_zooreg()]
#'
#' @examples
-#' library(timetk)
#'
#' # Create time-based tibble
#' data_tbl <- tibble::tibble(
diff --git a/R/make-tk_make_holiday_sequences.R b/R/make-tk_make_holiday_sequences.R
index 77ef5d3e..8e574863 100644
--- a/R/make-tk_make_holiday_sequences.R
+++ b/R/make-tk_make_holiday_sequences.R
@@ -47,7 +47,6 @@
#'
#' @examples
#' library(dplyr)
-#' library(timetk)
#'
#' # Set max.print to 50
#' options_old <- options()$max.print
@@ -73,7 +72,7 @@
#' # from an existing
#'
#' # Create index of days that FB stock will be traded in 2017 based on 2016 + holidays
-#' FB_tbl <- FANG %>% filter(symbol == "FB")
+#' FB_tbl <- FANG %>% dplyr::filter(symbol == "FB")
#'
#' holidays <- tk_make_holiday_sequence(
#' start_date = "2016",
diff --git a/R/make-tk_make_timeseries.R b/R/make-tk_make_timeseries.R
index 891135c0..b904849e 100644
--- a/R/make-tk_make_timeseries.R
+++ b/R/make-tk_make_timeseries.R
@@ -92,7 +92,6 @@
#'
#' @examples
#' library(dplyr)
-#' library(timetk)
#'
#' # Set max.print to 50
#' options_old <- options()$max.print
diff --git a/R/make-tk_make_timeseries_future.R b/R/make-tk_make_timeseries_future.R
index bb15d83b..ccf2217c 100644
--- a/R/make-tk_make_timeseries_future.R
+++ b/R/make-tk_make_timeseries_future.R
@@ -73,7 +73,6 @@
#'
#' @examples
#' library(dplyr)
-#' library(timetk)
#'
#' # Basic example - By 3 seconds
#' idx <- tk_make_timeseries("2016-01-01 00:00:00", by = "3 sec", length_out = 3)
@@ -100,7 +99,7 @@
#' # - Combine holiday sequences with future sequences
#'
#' # Create index of days that FB stock will be traded in 2017 based on 2016 + holidays
-#' FB_tbl <- FANG %>% filter(symbol == "FB")
+#' FB_tbl <- FANG %>% dplyr::filter(symbol == "FB")
#'
#' holidays <- tk_make_holiday_sequence(
#' start_date = "2017-01-01",
diff --git a/R/plot-acf_diagnostics.R b/R/plot-acf_diagnostics.R
index 0592bf4d..b63f33c0 100644
--- a/R/plot-acf_diagnostics.R
+++ b/R/plot-acf_diagnostics.R
@@ -85,7 +85,6 @@
#' @examples
#' library(dplyr)
#' library(ggplot2)
-#' library(timetk)
#'
#'
#' # Apply Transformations
diff --git a/R/plot-anomaly_diagnostics.R b/R/plot-anomaly_diagnostics.R
index 13e411c6..0c96abd9 100644
--- a/R/plot-anomaly_diagnostics.R
+++ b/R/plot-anomaly_diagnostics.R
@@ -104,7 +104,6 @@
#'
#' @examples
#' library(dplyr)
-#' library(timetk)
#'
#' walmart_sales_weekly %>%
#' group_by(id) %>%
diff --git a/R/plot-seasonal_diagnostics.R b/R/plot-seasonal_diagnostics.R
index ce1f529e..a8c47331 100644
--- a/R/plot-seasonal_diagnostics.R
+++ b/R/plot-seasonal_diagnostics.R
@@ -60,7 +60,6 @@
#' @examples
#' \donttest{
#' library(dplyr)
-#' library(timetk)
#'
#' # ---- MULTIPLE FREQUENCY ----
#' # Taylor 30-minute dataset from forecast package
diff --git a/R/plot-stl_diagnostics.R b/R/plot-stl_diagnostics.R
index 32749509..d1215789 100644
--- a/R/plot-stl_diagnostics.R
+++ b/R/plot-stl_diagnostics.R
@@ -53,7 +53,6 @@
#'
#' @examples
#' library(dplyr)
-#' library(timetk)
#'
#' # ---- SINGLE TIME SERIES DECOMPOSITION ----
#' m4_hourly %>%
diff --git a/R/plot-time_series.R b/R/plot-time_series.R
index f614ebb8..54146317 100644
--- a/R/plot-time_series.R
+++ b/R/plot-time_series.R
@@ -110,7 +110,6 @@
#'
#' library(dplyr)
#' library(lubridate)
-#' library(timetk)
#'
#' # Works with individual time series
#' FANG %>%
diff --git a/R/plot-time_series_boxplot.R b/R/plot-time_series_boxplot.R
index d65f0db2..46f30e95 100644
--- a/R/plot-time_series_boxplot.R
+++ b/R/plot-time_series_boxplot.R
@@ -122,7 +122,6 @@
#' \donttest{
#' library(dplyr)
#' library(lubridate)
-#' library(timetk)
#'
#' # Works with individual time series
#' FANG %>%
diff --git a/R/recipes-step_box_cox.R b/R/recipes-step_box_cox.R
index c751e489..22b895fd 100644
--- a/R/recipes-step_box_cox.R
+++ b/R/recipes-step_box_cox.R
@@ -61,13 +61,11 @@
#'
#' @examples
#' library(dplyr)
-#' library(tidyr)
#' library(recipes)
-#' library(timetk)
#'
#' FANG_wide <- FANG %>%
-#' select(symbol, date, adjusted) %>%
-#' pivot_wider(names_from = symbol, values_from = adjusted)
+#' select(symbol, date, adjusted) %>%
+#' tidyr::pivot_wider(names_from = symbol, values_from = adjusted)
#'
#' recipe_box_cox <- recipe(~ ., data = FANG_wide) %>%
#' step_box_cox(FB, AMZN, NFLX, GOOG) %>%
diff --git a/R/recipes-step_diff.R b/R/recipes-step_diff.R
index 5c514243..9178f6ae 100644
--- a/R/recipes-step_diff.R
+++ b/R/recipes-step_diff.R
@@ -54,15 +54,12 @@
#' @rdname step_diff
#'
#' @examples
-#' library(dplyr)
-#' library(tidyr)
#' library(recipes)
-#' library(timetk)
#'
#'
#' FANG_wide <- FANG %>%
-#' select(symbol, date, adjusted) %>%
-#' pivot_wider(names_from = symbol, values_from = adjusted)
+#' dplyr::select(symbol, date, adjusted) %>%
+#' tidyr::pivot_wider(names_from = symbol, values_from = adjusted)
#'
#'
#' # Make and apply recipe ----
diff --git a/R/recipes-step_fourier.R b/R/recipes-step_fourier.R
index 35e684b2..7d94f7d6 100644
--- a/R/recipes-step_fourier.R
+++ b/R/recipes-step_fourier.R
@@ -88,7 +88,6 @@
#' @examples
#' library(recipes)
#' library(dplyr)
-#' library(timetk)
#'
#' FB_tbl <- FANG %>%
#' filter(symbol == "FB") %>%
@@ -200,7 +199,7 @@ prep.step_fourier <- function(x, training, info = NULL, ...) {
scale_factor_calculated <- training[,col_names[1]] %>%
tk_index() %>%
tk_get_timeseries_summary() %>%
- dplyr::pull(diff.median)
+ dplyr::pull("diff.median")
step_fourier_new(
terms = x$terms,
diff --git a/R/recipes-step_holiday_signature.R b/R/recipes-step_holiday_signature.R
index 032adae0..31885429 100644
--- a/R/recipes-step_holiday_signature.R
+++ b/R/recipes-step_holiday_signature.R
@@ -87,12 +87,10 @@
#'
#' @examples
#' library(recipes)
-#' library(timetk)
-#' library(tibble)
#' library(dplyr)
#'
#' # Sample Data
-#' dates_in_2017_tbl <- tibble(
+#' dates_in_2017_tbl <- tibble::tibble(
#' index = tk_make_timeseries("2017-01-01", "2017-12-31", by = "day")
#' )
#'
diff --git a/R/recipes-step_log_interval.R b/R/recipes-step_log_interval.R
index 21bf22b3..0af6bb4d 100644
--- a/R/recipes-step_log_interval.R
+++ b/R/recipes-step_log_interval.R
@@ -48,13 +48,11 @@
#'
#' @examples
#' library(dplyr)
-#' library(tidyr)
#' library(recipes)
-#' library(timetk)
#'
#' FANG_wide <- FANG %>%
#' select(symbol, date, adjusted) %>%
-#' pivot_wider(names_from = symbol, values_from = adjusted)
+#' tidyr::pivot_wider(names_from = symbol, values_from = adjusted)
#'
#' recipe_log_interval <- recipe(~ ., data = FANG_wide) %>%
#' step_log_interval(FB, AMZN, NFLX, GOOG, offset = 1) %>%
@@ -62,7 +60,7 @@
#'
#' recipe_log_interval %>%
#' bake(FANG_wide) %>%
-#' pivot_longer(-date) %>%
+#' tidyr::pivot_longer(-date) %>%
#' plot_time_series(date, value, name, .smooth = FALSE, .interactive = FALSE)
#'
#' recipe_log_interval %>% tidy(1)
diff --git a/R/recipes-step_slidify.R b/R/recipes-step_slidify.R
index 1792deec..6a362876 100644
--- a/R/recipes-step_slidify.R
+++ b/R/recipes-step_slidify.R
@@ -104,7 +104,6 @@
#' library(recipes)
#' library(dplyr)
#' library(ggplot2)
-#' library(timetk)
#'
#' # Training Data
#' FB_tbl <- FANG %>%
diff --git a/R/recipes-step_smooth.R b/R/recipes-step_smooth.R
index 5f8e2cfb..d39a100d 100644
--- a/R/recipes-step_smooth.R
+++ b/R/recipes-step_smooth.R
@@ -100,7 +100,6 @@
#' library(recipes)
#' library(dplyr)
#' library(ggplot2)
-#' library(timetk)
#'
#' # Training Data
#' FB_tbl <- FANG %>%
diff --git a/R/recipes-step_timeseries_signature.R b/R/recipes-step_timeseries_signature.R
index 13c75fbd..f72ef511 100644
--- a/R/recipes-step_timeseries_signature.R
+++ b/R/recipes-step_timeseries_signature.R
@@ -66,9 +66,8 @@
#' @examples
#' library(recipes)
#' library(dplyr)
-#' library(timetk)
#'
-#' FB_tbl <- FANG %>% filter(symbol == "FB")
+#' FB_tbl <- FANG %>% dplyr::filter(symbol == "FB")
#'
#' # Create a recipe object with a timeseries signature step
#' rec_obj <- recipe(adjusted ~ ., data = FB_tbl) %>%
diff --git a/R/recipes-step_ts_clean.R b/R/recipes-step_ts_clean.R
index ae62f6fa..031bfd35 100644
--- a/R/recipes-step_ts_clean.R
+++ b/R/recipes-step_ts_clean.R
@@ -63,7 +63,6 @@
#' library(dplyr)
#' library(tidyr)
#' library(recipes)
-#' library(timetk)
#'
#' # Get missing values
#' FANG_wide <- FANG %>%
diff --git a/R/recipes-step_ts_impute.R b/R/recipes-step_ts_impute.R
index c38a65f7..584e5a95 100644
--- a/R/recipes-step_ts_impute.R
+++ b/R/recipes-step_ts_impute.R
@@ -66,14 +66,12 @@
#' @examples
#'
#' library(dplyr)
-#' library(tidyr)
#' library(recipes)
-#' library(timetk)
#'
#' # Get missing values
#' FANG_wide <- FANG %>%
#' select(symbol, date, adjusted) %>%
-#' pivot_wider(names_from = symbol, values_from = adjusted) %>%
+#' tidyr::pivot_wider(names_from = symbol, values_from = adjusted) %>%
#' pad_by_time()
#'
#' FANG_wide
diff --git a/R/recipes-step_ts_pad.R b/R/recipes-step_ts_pad.R
index e9bc6cd6..08664fd1 100644
--- a/R/recipes-step_ts_pad.R
+++ b/R/recipes-step_ts_pad.R
@@ -67,7 +67,6 @@
#' @examples
#' library(recipes)
#' library(dplyr)
-#' library(timetk)
#'
#' FB_tbl <- FANG %>%
#' filter(symbol == "FB") %>%
diff --git a/R/rsample-plot_time_series_cv_plan.R b/R/rsample-plot_time_series_cv_plan.R
index 0a9c39d3..ee2c3303 100644
--- a/R/rsample-plot_time_series_cv_plan.R
+++ b/R/rsample-plot_time_series_cv_plan.R
@@ -30,7 +30,6 @@
#' @examples
#' library(dplyr)
#' library(rsample)
-#' library(timetk)
#'
#' FB_tbl <- FANG %>%
#' filter(symbol == "FB") %>%
diff --git a/R/rsample-time_series_cv.R b/R/rsample-time_series_cv.R
index 339529be..96a21552 100644
--- a/R/rsample-time_series_cv.R
+++ b/R/rsample-time_series_cv.R
@@ -98,10 +98,9 @@
#'
#' @examples
#' library(dplyr)
-#' library(timetk)
#'
#' # DATA ----
-#' m750 <- m4_monthly %>% filter(id == "M750")
+#' m750 <- m4_monthly %>% dplyr::filter(id == "M750")
#'
#'
#' # RESAMPLE SPEC ----
diff --git a/R/rsample-time_series_split.R b/R/rsample-time_series_split.R
index 8d4683cb..6075bd46 100644
--- a/R/rsample-time_series_split.R
+++ b/R/rsample-time_series_split.R
@@ -64,10 +64,9 @@
#'
#' @examples
#' library(dplyr)
-#' library(timetk)
#'
#' # DATA ----
-#' m750 <- m4_monthly %>% filter(id == "M750")
+#' m750 <- m4_monthly %>% dplyr::filter(id == "M750")
#'
#' # Get the most recent 3 years as testing, and previous 10 years as training
#' m750 %>%
diff --git a/R/rsample-tk_time_series_cv_plan.R b/R/rsample-tk_time_series_cv_plan.R
index 047fffd4..15c942b3 100644
--- a/R/rsample-tk_time_series_cv_plan.R
+++ b/R/rsample-tk_time_series_cv_plan.R
@@ -26,7 +26,6 @@
#' @examples
#' library(dplyr)
#' library(rsample)
-#' library(timetk)
#'
#' FB_tbl <- FANG %>%
#' filter(symbol == "FB") %>%
diff --git a/R/utils-dates.R b/R/utils-dates.R
index 1550a4b9..8fc53d2d 100644
--- a/R/utils-dates.R
+++ b/R/utils-dates.R
@@ -17,7 +17,6 @@
#' See [padr helpers.R](https://github.com/EdwinTh/padr/blob/master/R/helpers.R)
#'
#' @examples
-#' library(timetk)
#' library(dplyr)
#'
#' FANG %>%
diff --git a/R/vec-box_cox.R b/R/vec-box_cox.R
index 9f019c47..06f341c6 100644
--- a/R/vec-box_cox.R
+++ b/R/vec-box_cox.R
@@ -2,8 +2,8 @@
#'
#' This is mainly a wrapper for the BoxCox transformation from the `forecast`
#' R package. The `box_cox_vec()` function performs the transformation.
-#' The `box_cox_inv_vec()` inverts the transformation.
-#' The `auto_lambda()` helps in selecting the optimal `lambda` value.
+#' `box_cox_inv_vec()` inverts the transformation.
+#' `auto_lambda()` helps in selecting the optimal `lambda` value.
#'
#' @param x A numeric vector.
#' @param lambda The box cox transformation parameter.
@@ -48,9 +48,7 @@
#'
#' @examples
#' library(dplyr)
-#' library(timetk)
-#'
-#' d10_daily <- m4_daily %>% filter(id == "D10")
+#' d10_daily <- m4_daily %>% dplyr::filter(id == "D10")
#'
#' # --- VECTOR ----
#'
@@ -60,11 +58,10 @@
#' # --- MUTATE ----
#'
#' m4_daily %>%
-#' group_by(id) %>%
-#' mutate(value_bc = box_cox_vec(value))
+#' dplyr::group_by(id) %>%
+#' dplyr::mutate(value_bc = box_cox_vec(value))
#'
#' @name box_cox_vec
-#' @export
NULL
#' @rdname box_cox_vec
diff --git a/R/vec-diff.R b/R/vec-diff.R
index b5cad06e..e3850660 100644
--- a/R/vec-diff.R
+++ b/R/vec-diff.R
@@ -62,7 +62,6 @@
#'
#' @examples
#' library(dplyr)
-#' library(timetk)
#'
#' # --- USAGE ----
#'
diff --git a/R/vec-fourier.R b/R/vec-fourier.R
index c1263cdd..52161b6a 100644
--- a/R/vec-fourier.R
+++ b/R/vec-fourier.R
@@ -64,10 +64,7 @@
#' - Missing Value Imputation for Time Series: [ts_impute_vec()], [ts_clean_vec()]
#'
#' @examples
-#' library(tibble)
#' library(dplyr)
-#' library(tidyr)
-#' library(timetk)
#'
#' # Set max.print to 50
#' options_old <- options()$max.print
@@ -88,7 +85,7 @@
#' C2_7 = fourier_vec(date, period = 7*24, K = 2, type = "cos")
#' ) %>%
#' # Visualize
-#' pivot_longer(cols = contains("_"), names_to = "name", values_to = "value") %>%
+#' tidyr::pivot_longer(cols = contains("_"), names_to = "name", values_to = "value") %>%
#' plot_time_series(
#' date, value, .color_var = name,
#' .smooth = FALSE,
diff --git a/R/vec-lag.R b/R/vec-lag.R
index 72ccf356..b32c9195 100644
--- a/R/vec-lag.R
+++ b/R/vec-lag.R
@@ -41,7 +41,6 @@
#'
#' @examples
#' library(dplyr)
-#' library(timetk)
#'
#' # --- VECTOR ----
#'
diff --git a/R/vec-log_interval.R b/R/vec-log_interval.R
index 94f2a612..685b46ed 100644
--- a/R/vec-log_interval.R
+++ b/R/vec-log_interval.R
@@ -51,7 +51,6 @@
#'
#' @examples
#' library(dplyr)
-#' library(timetk)
#'
#' values_trans <- log_interval_vec(1:10, limit_lower = 0, limit_upper = 11)
#' values_trans
diff --git a/R/vec-normalize.R b/R/vec-normalize.R
index d6f5d919..347a3c07 100644
--- a/R/vec-normalize.R
+++ b/R/vec-normalize.R
@@ -30,9 +30,8 @@
#'
#' @examples
#' library(dplyr)
-#' library(timetk)
#'
-#' d10_daily <- m4_daily %>% filter(id == "D10")
+#' d10_daily <- m4_daily %>% dplyr::filter(id == "D10")
#'
#' # --- VECTOR ----
#'
diff --git a/R/vec-slidify.R b/R/vec-slidify.R
index 1b9e466d..f21f0cf7 100644
--- a/R/vec-slidify.R
+++ b/R/vec-slidify.R
@@ -80,7 +80,6 @@
#' @examples
#' library(dplyr)
#' library(ggplot2)
-#' library(timetk)
#'
#' # Training Data
#' FB_tbl <- FANG %>%
@@ -98,7 +97,7 @@
#' .align = "center")) %>%
#' ggplot(aes(date, adjusted)) +
#' geom_line() +
-#' geom_line(aes(y = adjusted_30_ma), color = "blue")
+#' geom_line(aes(y = adjusted_30_ma), color = "blue", na.rm = TRUE)
#'
#' # ---- FORMULA FORMAT ----
#' # - Anonymous function `.f = ~ mean(., na.rm = TRUE)` is used
@@ -110,7 +109,7 @@
#' .align = "center")) %>%
#' ggplot(aes(date, adjusted)) +
#' geom_line() +
-#' geom_line(aes(y = adjusted_30_ma), color = "blue")
+#' geom_line(aes(y = adjusted_30_ma), color = "blue", na.rm = TRUE)
#'
#' # ---- PARTIAL VALUES ----
#' # - set `.partial = TRUE`
diff --git a/R/vec-smooth.R b/R/vec-smooth.R
index aa68eaf4..c5929983 100644
--- a/R/vec-smooth.R
+++ b/R/vec-smooth.R
@@ -60,7 +60,6 @@
#' @examples
#' library(dplyr)
#' library(ggplot2)
-#' library(timetk)
#'
#' # Training Data
#' FB_tbl <- FANG %>%
diff --git a/R/vec-standardize.R b/R/vec-standardize.R
index 613d03f2..12e9cd67 100644
--- a/R/vec-standardize.R
+++ b/R/vec-standardize.R
@@ -33,9 +33,8 @@
#'
#' @examples
#' library(dplyr)
-#' library(timetk)
#'
-#' d10_daily <- m4_daily %>% filter(id == "D10")
+#' d10_daily <- m4_daily %>% dplyr::filter(id == "D10")
#'
#' # --- VECTOR ----
#'
diff --git a/R/vec-ts_clean.R b/R/vec-ts_clean.R
index 998d3c70..1485c268 100644
--- a/R/vec-ts_clean.R
+++ b/R/vec-ts_clean.R
@@ -50,7 +50,6 @@
#'
#' @examples
#' library(dplyr)
-#' library(timetk)
#'
#'
#' # --- VECTOR ----
diff --git a/R/vec-ts_impute.R b/R/vec-ts_impute.R
index d8ce34bd..bf015231 100644
--- a/R/vec-ts_impute.R
+++ b/R/vec-ts_impute.R
@@ -51,7 +51,6 @@
#'
#' @examples
#' library(dplyr)
-#' library(timetk)
#'
#'
#' # --- VECTOR ----
diff --git a/R/zzz.R b/R/zzz.R
index 3fd0f2d9..a3ffb9ec 100644
--- a/R/zzz.R
+++ b/R/zzz.R
@@ -37,7 +37,7 @@ maybe_register_s3_methods <- function() {
# ----------------------------------------------------------------------------
- if (rlang::is_installed("tune") && utils::packageVersion("tune") >= "0.1.1.9000") {
+ if (rlang::is_installed("tune (>= 0.1.2)")) {
req_pkgs_names <- grep("^required_pkgs\\.", names, value = TRUE)
req_pkgs_classes <- gsub("required_pkgs.", "", req_pkgs_names)
diff --git a/docs/404.html b/docs/404.html
deleted file mode 100644
index cc0d0fbe..00000000
--- a/docs/404.html
+++ /dev/null
@@ -1,175 +0,0 @@
-
-
-
-
-
-
-
-Page not found (404) • timetk
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Skip to contents
-
-
-
-
-
timetk
-
-
2.8.4
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Content not found. Please use links in the navbar.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/docs/apple-touch-icon-120x120.png b/docs/apple-touch-icon-120x120.png
deleted file mode 100644
index f3c3410b..00000000
Binary files a/docs/apple-touch-icon-120x120.png and /dev/null differ
diff --git a/docs/apple-touch-icon-152x152.png b/docs/apple-touch-icon-152x152.png
deleted file mode 100644
index 80a91a9d..00000000
Binary files a/docs/apple-touch-icon-152x152.png and /dev/null differ
diff --git a/docs/apple-touch-icon-180x180.png b/docs/apple-touch-icon-180x180.png
deleted file mode 100644
index da34e9a2..00000000
Binary files a/docs/apple-touch-icon-180x180.png and /dev/null differ
diff --git a/docs/apple-touch-icon-60x60.png b/docs/apple-touch-icon-60x60.png
deleted file mode 100644
index 21f5ee81..00000000
Binary files a/docs/apple-touch-icon-60x60.png and /dev/null differ
diff --git a/docs/apple-touch-icon-76x76.png b/docs/apple-touch-icon-76x76.png
deleted file mode 100644
index 9f202a95..00000000
Binary files a/docs/apple-touch-icon-76x76.png and /dev/null differ
diff --git a/docs/apple-touch-icon.png b/docs/apple-touch-icon.png
deleted file mode 100644
index b2fce0f5..00000000
Binary files a/docs/apple-touch-icon.png and /dev/null differ
diff --git a/docs/articles/TK00_Time_Series_Coercion.html b/docs/articles/TK00_Time_Series_Coercion.html
deleted file mode 100644
index e5530898..00000000
--- a/docs/articles/TK00_Time_Series_Coercion.html
+++ /dev/null
@@ -1,1007 +0,0 @@
-
-
-
-
-
-
-
-
-Time Series Class Conversion • timetk
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Skip to contents
-
-
-
-
-
timetk
-
-
2.8.4
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-This vignette covers time series class conversion to
-and from the many time series classes in R including the general data
-frame (or tibble) and the various time series classes (xts
,
-zoo
, and ts
).
-
-
Introduction
-
-
The time series landscape in R is vast, deep, and complex causing
-many inconsistencies in data attributes and formats ultimately making it
-difficult to coerce between the different data structures. The
-zoo
and xts
packages solved a number of the
-issues in dealing with the various classes (ts
,
-zoo
, xts
, irts
,
-msts
, and the list goes on…). However, because these
-packages deal in classes other than data frame, the issues with
-conversion between tbl
and other time series object classes
-are still present.
-
The timetk
package provides tools that solve the issues
-with conversion, maximizing attribute extensibility (the required data
-attributes are retained during the conversion to each of the primary
-time series classes). The following tools are available to coerce and
-retrieve key information:
-
-Conversion functions : tk_tbl
,
-tk_ts
, tk_xts
, tk_zoo
, and
-tk_zooreg
. These functions coerce time-based tibbles
-tbl
to and from each of the main time-series data types
-xts
, zoo
, zooreg
,
-ts
, maintaining the time-based index.
-Index function : tk_index
returns
-the index. When the argument, timetk_idx = TRUE
, A
-time-based index (non-regularized index) of forecast
-objects, models, and ts
objects is returned if present.
-Refer to tk_ts()
to learn about non-regularized index
-persistence during the conversion process.
-
-
This vignette includes a brief case study on conversion issues and
-then a detailed explanation of timetk
function conversion
-between time-based tbl
objects and several primary time
-series classes (xts
, zoo
, zooreg
-and ts
).
-
-
-
Prerequisites
-
-
Before we get started, load the following packages.
-
-
-
-
Data
-
-
We’ll use the “Q10” dataset - The first ID from a sample a quarterly
-datasets (see m4_quarterly
) from the M4 Competition . The return
-structure is a tibble
, which is not conducive to many of
-the popular time series analysis packages including
-quantmod
, TTR
, forecast
and many
-others.
-
-q10_quarterly <- m4_quarterly %>% filter ( id == "Q10" )
-q10_quarterly
-
## # A tibble: 59 x 3
-## id date value
-## <fct> <date> <dbl>
-## 1 Q10 2000-01-01 2 329
-## 2 Q10 2000-04-01 2 350.
-## 3 Q10 2000-07-01 2 333.
-## 4 Q10 2000-10-01 2 382.
-## 5 Q10 2001-01-01 2 383.
-## 6 Q10 2001-04-01 2 405
-## 7 Q10 2001-07-01 2 411
-## 8 Q10 2001-10-01 2 428.
-## 9 Q10 2002-01-01 2 392.
-## 10 Q10 2002-04-01 2 418.
-## # i 49 more rows
-
-
-
Case Study: Conversion issues with ts()
-
-
The ts
object class has roots in the stats
-package and many popular packages use this time series data structure
-including the popular forecast
package. With that said, the
-ts
data structure is the most difficult to coerce back and
-forth because by default it does not contain a time-based index. Rather
-it uses a regularized index computed using the start
and
-frequency
arguments. Conversion to ts
is done
-using the ts()
function from the stats
-library, which results in various problems.
-
-
Problems
-
-
First, only numeric columns get coerced. If the user forgets to add
-the [,"pct"]
to drop the “date” column, ts()
-returns dates in numeric format which is not what the user wants.
-
-# date column gets coerced to numeric
-ts ( q10_quarterly , start = c ( 2000 , 1 ) , freq = 4 ) %>%
- head ( )
-
## id date value
-## [1,] 1 10957 2329.0
-## [2,] 1 11048 2349.9
-## [3,] 1 11139 2332.9
-## [4,] 1 11231 2381.5
-## [5,] 1 11323 2382.6
-## [6,] 1 11413 2405.0
-
The correct method is to call the specific column desired. However,
-this presents a new issue. The date index is lost, and a different
-“regularized” index is built using the start
and
-frequency
attributes.
-
-q10_quarterly_ts <- ts ( q10_quarterly $ value , start = c ( 2000 , 1 ) , freq = 4 )
-q10_quarterly_ts
-
## Qtr1 Qtr2 Qtr3 Qtr4
-## 2000 2329.0 2349.9 2332.9 2381.5
-## 2001 2382.6 2405.0 2411.0 2428.5
-## 2002 2391.6 2418.5 2406.5 2418.5
-## 2003 2420.4 2438.6 2448.7 2470.6
-## 2004 2484.5 2495.9 2492.5 2521.6
-## 2005 2538.1 2549.7 2587.2 2585.0
-## 2006 2602.6 2615.3 2654.0 2680.8
-## 2007 2665.4 2645.1 2647.5 2719.2
-## 2008 2677.0 2650.9 2667.8 2660.2
-## 2009 2554.7 2522.7 2510.0 2541.7
-## 2010 2499.1 2527.9 2519.0 2536.3
-## 2011 2493.2 2542.1 2501.6 2516.3
-## 2012 2510.5 2548.4 2548.6 2530.7
-## 2013 2497.1 2520.4 2516.9 2505.5
-## 2014 2513.9 2549.9 2555.3
-
We can see from the structure (using the str()
function)
-that the regularized time series is present, but there is no date index
-retained.
-
-# No date index attribute
-str ( q10_quarterly_ts )
-
## Time-Series [1:59] from 2000 to 2014: 2329 2350 2333 2382 2383 ...
-
We can get the index using the index()
function from the
-zoo
package. The index retained is a regular sequence of
-numeric values. In many cases, the regularized values cannot be coerced
-back to the original time-base because the date and date time data
-contains significantly more information (i.e. year-month-day,
-hour-minute-second, and timezone attributes) and the data may not be on
-a regularized interval (frequency).
-
-# Regularized numeric sequence
-zoo :: index ( q10_quarterly_ts )
-
## [1] 2000.00 2000.25 2000.50 2000.75 2001.00 2001.25 2001.50 2001.75 2002.00
-## [10] 2002.25 2002.50 2002.75 2003.00 2003.25 2003.50 2003.75 2004.00 2004.25
-## [19] 2004.50 2004.75 2005.00 2005.25 2005.50 2005.75 2006.00 2006.25 2006.50
-## [28] 2006.75 2007.00 2007.25 2007.50 2007.75 2008.00 2008.25 2008.50 2008.75
-## [37] 2009.00 2009.25 2009.50 2009.75 2010.00 2010.25 2010.50 2010.75 2011.00
-## [46] 2011.25 2011.50 2011.75 2012.00 2012.25 2012.50 2012.75 2013.00 2013.25
-## [55] 2013.50 2013.75 2014.00 2014.25 2014.50
-
-
-
Solution
-
-
The timetk
package contains a new function,
-tk_ts()
, that enables maintaining the original date index
-as an attribute. When we repeat the tbl
to ts
-conversion process using the new function, tk_ts()
, we can
-see a few differences.
-
First, only numeric columns get coerced, which prevents unintended
-consequences due to R conversion rules (e.g. dates getting
-unintentionally converted or characters causing the homogeneous data
-structure converting all numeric values to character). If a column is
-dropped, the user gets a warning.
-
-# date automatically dropped and user is warned
-q10_quarterly_ts_timetk <- tk_ts ( q10_quarterly , start = 2000 , freq = 4 )
-
## Warning: Non-numeric columns being dropped: id, date
-
-
## Qtr1 Qtr2 Qtr3 Qtr4
-## 2000 2329.0 2349.9 2332.9 2381.5
-## 2001 2382.6 2405.0 2411.0 2428.5
-## 2002 2391.6 2418.5 2406.5 2418.5
-## 2003 2420.4 2438.6 2448.7 2470.6
-## 2004 2484.5 2495.9 2492.5 2521.6
-## 2005 2538.1 2549.7 2587.2 2585.0
-## 2006 2602.6 2615.3 2654.0 2680.8
-## 2007 2665.4 2645.1 2647.5 2719.2
-## 2008 2677.0 2650.9 2667.8 2660.2
-## 2009 2554.7 2522.7 2510.0 2541.7
-## 2010 2499.1 2527.9 2519.0 2536.3
-## 2011 2493.2 2542.1 2501.6 2516.3
-## 2012 2510.5 2548.4 2548.6 2530.7
-## 2013 2497.1 2520.4 2516.9 2505.5
-## 2014 2513.9 2549.9 2555.3
-
Second, the data returned has a few additional attributes. The most
-important of which is a numeric attribute, “index”, which contains the
-original date information as a number. The ts()
function
-will not preserve this index while tk_ts()
will preserve
-the index in numeric form along with the time zone and class.
-
-# More attributes including time index, time class, time zone
-str ( q10_quarterly_ts_timetk )
-
## Time-Series [1:59, 1] from 2000 to 2014: 2329 2350 2333 2382 2383 ...
-## - attr(*, "dimnames")=List of 2
-## ..$ : NULL
-## ..$ : chr "value"
-## - attr(*, "index")= num [1:59] 9.47e+08 9.55e+08 9.62e+08 9.70e+08 9.78e+08 ...
-## ..- attr(*, "tzone")= chr "UTC"
-## ..- attr(*, "tclass")= chr "Date"
-
-
-
Advantages of conversion with tk_tbl()
-
-
Since we used the tk_ts()
during conversion, we can
-extract the original index in date format using
-tk_index(timetk_idx = TRUE)
(the default is
-timetk_idx = FALSE
which returns the default regularized
-index).
-
-# Can now retrieve the original date index
-timetk_index <- q10_quarterly_ts_timetk %>%
- tk_index ( timetk_idx = TRUE )
-head ( timetk_index )
-
## [1] "2000-01-01" "2000-04-01" "2000-07-01" "2000-10-01" "2001-01-01"
-## [6] "2001-04-01"
-
-
## [1] "Date"
-
Next, the tk_tbl()
function has an argument
-timetk_idx
also which can be used to select which index to
-return. First, we show conversion using the default index. Notice that
-the index returned is “regularized” meaning its actually a numeric index
-rather than a time-based index.
-
-# Conversion back to tibble using the default index (regularized)
-q10_quarterly_ts_timetk %>%
- tk_tbl ( index_rename = "date" , timetk_idx = FALSE )
-
## # A tibble: 59 x 2
-## index value
-## <yearqtr> <dbl>
-## 1 2000 Q1 2 329
-## 2 2000 Q2 2 350.
-## 3 2000 Q3 2 333.
-## 4 2000 Q4 2 382.
-## 5 2001 Q1 2 383.
-## 6 2001 Q2 2 405
-## 7 2001 Q3 2 411
-## 8 2001 Q4 2 428.
-## 9 2002 Q1 2 392.
-## 10 2002 Q2 2 418.
-## # i 49 more rows
-
We can now get the original date index using the
-tk_tbl()
argument timetk_idx = TRUE
.
-
-# Conversion back to tibble now using the timetk index (date / date-time)
-q10_quarterly_timetk <- q10_quarterly_ts_timetk %>%
- tk_tbl ( timetk_idx = TRUE ) %>%
- rename ( date = index )
-q10_quarterly_timetk
-
## # A tibble: 59 x 2
-## date value
-## <date> <dbl>
-## 1 2000-01-01 2 329
-## 2 2000-04-01 2 350.
-## 3 2000-07-01 2 333.
-## 4 2000-10-01 2 382.
-## 5 2001-01-01 2 383.
-## 6 2001-04-01 2 405
-## 7 2001-07-01 2 411
-## 8 2001-10-01 2 428.
-## 9 2002-01-01 2 392.
-## 10 2002-04-01 2 418.
-## # i 49 more rows
-
We can see that in this case (and in most cases) you can get the same
-data frame you began with.
-
-# Comparing the coerced tibble with the original tibble
-identical ( q10_quarterly_timetk , q10_quarterly %>% select ( - id ) )
-
## [1] TRUE
-
-
-
-
Conversion Methods
-
-
Using the q10_quarterly
, we’ll go through the various
-conversion methods using tk_tbl
, tk_xts
,
-tk_zoo
, tk_zooreg
, and tk_ts
.
-
-
From tbl
-
-
The starting point is the q10_quarterly
. We will coerce
-this into xts
, zoo
, zooreg
and
-ts
classes.
-
-
## # A tibble: 59 x 3
-## id date value
-## <fct> <date> <dbl>
-## 1 Q10 2000-01-01 2 329
-## 2 Q10 2000-04-01 2 350.
-## 3 Q10 2000-07-01 2 333.
-## 4 Q10 2000-10-01 2 382.
-## 5 Q10 2001-01-01 2 383.
-## 6 Q10 2001-04-01 2 405
-## 7 Q10 2001-07-01 2 411
-## 8 Q10 2001-10-01 2 428.
-## 9 Q10 2002-01-01 2 392.
-## 10 Q10 2002-04-01 2 418.
-## # i 49 more rows
-
-
to xts
-
-
Use tk_xts()
. By default “date” is used as the date
-index and the “date” column is dropped from the output. Only numeric
-columns are coerced to avoid unintentional conversion issues.
-
-# End
-q10_quarterly_xts <- tk_xts ( q10_quarterly )
-
## Warning: Non-numeric columns being dropped: id, date
-
## Using column `date` for date_var.
-
-
## value
-## 2000-01-01 2329.0
-## 2000-04-01 2349.9
-## 2000-07-01 2332.9
-## 2000-10-01 2381.5
-## 2001-01-01 2382.6
-## 2001-04-01 2405.0
-
Use the select
argument to specify which columns to
-drop. Use the date_var
argument to specify which column to
-use as the date index. Notice the message and warning are no longer
-present.
-
-# End - Using `select` and `date_var` args
-tk_xts ( q10_quarterly , select = - ( id : date ) , date_var = date ) %>%
- head ( )
-
## value
-## 2000-01-01 2329.0
-## 2000-04-01 2349.9
-## 2000-07-01 2332.9
-## 2000-10-01 2381.5
-## 2001-01-01 2382.6
-## 2001-04-01 2405.0
-
Also, as an alternative, we can set silent = TRUE
to
-bypass the warnings since the default dropping of the “date” column is
-what is desired. Notice no warnings or messages.
-
-# End - Using `silent` to silence warnings
-tk_xts ( q10_quarterly , silent = TRUE ) %>%
- head ( )
-
## value
-## 2000-01-01 2329.0
-## 2000-04-01 2349.9
-## 2000-07-01 2332.9
-## 2000-10-01 2381.5
-## 2001-01-01 2382.6
-## 2001-04-01 2405.0
-
-
-
to zoo
-
-
Use tk_zoo()
. Same as when coercing to xts, the
-non-numeric “date” column is automatically dropped and the index is
-automatically selected as the date column.
-
-# End
-q10_quarterly_zoo <- tk_zoo ( q10_quarterly , silent = TRUE )
-head ( q10_quarterly_zoo )
-
## value
-## 2000-01-01 2329.0
-## 2000-04-01 2349.9
-## 2000-07-01 2332.9
-## 2000-10-01 2381.5
-## 2001-01-01 2382.6
-## 2001-04-01 2405.0
-
-
-
to zooreg
-
-
Use tk_zooreg()
. Same as when coercing to xts, the
-non-numeric “date” column is automatically dropped. The regularized
-index is built from the function arguments start
and
-freq
.
-
-# End
-q10_quarterly_zooreg <- tk_zooreg ( q10_quarterly , start = 2000 , freq = 4 , silent = TRUE )
-head ( q10_quarterly_zooreg )
-
## value
-## 2000 Q1 2329.0
-## 2000 Q2 2349.9
-## 2000 Q3 2332.9
-## 2000 Q4 2381.5
-## 2001 Q1 2382.6
-## 2001 Q2 2405.0
-
The original time-based index is retained and can be accessed using
-tk_index(timetk_idx = TRUE)
.
-
-# Retrieve original time-based index
-tk_index ( q10_quarterly_zooreg , timetk_idx = TRUE ) %>%
- str ( )
-
## Date[1:59], format: "2000-01-01" "2000-04-01" "2000-07-01" "2000-10-01" "2001-01-01" ...
-
-
-
to ts
-
-
Use tk_ts()
. The non-numeric “date” column is
-automatically dropped. The regularized index is built from the function
-arguments.
-
-# End
-q10_quarterly_ts <- tk_ts ( q10_quarterly , start = 2000 , freq = 4 , silent = TRUE )
-q10_quarterly_ts
-
## Qtr1 Qtr2 Qtr3 Qtr4
-## 2000 2329.0 2349.9 2332.9 2381.5
-## 2001 2382.6 2405.0 2411.0 2428.5
-## 2002 2391.6 2418.5 2406.5 2418.5
-## 2003 2420.4 2438.6 2448.7 2470.6
-## 2004 2484.5 2495.9 2492.5 2521.6
-## 2005 2538.1 2549.7 2587.2 2585.0
-## 2006 2602.6 2615.3 2654.0 2680.8
-## 2007 2665.4 2645.1 2647.5 2719.2
-## 2008 2677.0 2650.9 2667.8 2660.2
-## 2009 2554.7 2522.7 2510.0 2541.7
-## 2010 2499.1 2527.9 2519.0 2536.3
-## 2011 2493.2 2542.1 2501.6 2516.3
-## 2012 2510.5 2548.4 2548.6 2530.7
-## 2013 2497.1 2520.4 2516.9 2505.5
-## 2014 2513.9 2549.9 2555.3
-
The original time-based index is retained and can be accessed using
-tk_index(timetk_idx = TRUE)
.
-
-# Retrieve original time-based index
-tk_index ( q10_quarterly_ts , timetk_idx = TRUE ) %>%
- str ( )
-
## Date[1:59], format: "2000-01-01" "2000-04-01" "2000-07-01" "2000-10-01" "2001-01-01" ...
-
-
-
-
To tbl
-
-
Going back to tibble is just as easy using tk_tbl()
.
-
-
From xts
-
-
-# Start
-head ( q10_quarterly_xts )
-
## value
-## 2000-01-01 2329.0
-## 2000-04-01 2349.9
-## 2000-07-01 2332.9
-## 2000-10-01 2381.5
-## 2001-01-01 2382.6
-## 2001-04-01 2405.0
-
Notice no loss of data going back to tbl
.
-
-# End
-tk_tbl ( q10_quarterly_xts )
-
## # A tibble: 59 x 2
-## index value
-## <date> <dbl>
-## 1 2000-01-01 2 329
-## 2 2000-04-01 2 350.
-## 3 2000-07-01 2 333.
-## 4 2000-10-01 2 382.
-## 5 2001-01-01 2 383.
-## 6 2001-04-01 2 405
-## 7 2001-07-01 2 411
-## 8 2001-10-01 2 428.
-## 9 2002-01-01 2 392.
-## 10 2002-04-01 2 418.
-## # i 49 more rows
-
-
-
From zoo
-
-
-# Start
-head ( q10_quarterly_zoo )
-
## value
-## 2000-01-01 2329.0
-## 2000-04-01 2349.9
-## 2000-07-01 2332.9
-## 2000-10-01 2381.5
-## 2001-01-01 2382.6
-## 2001-04-01 2405.0
-
Notice no loss of data going back to tbl
.
-
-# End
-tk_tbl ( q10_quarterly_zoo )
-
## # A tibble: 59 x 2
-## index value
-## <date> <dbl>
-## 1 2000-01-01 2 329
-## 2 2000-04-01 2 350.
-## 3 2000-07-01 2 333.
-## 4 2000-10-01 2 382.
-## 5 2001-01-01 2 383.
-## 6 2001-04-01 2 405
-## 7 2001-07-01 2 411
-## 8 2001-10-01 2 428.
-## 9 2002-01-01 2 392.
-## 10 2002-04-01 2 418.
-## # i 49 more rows
-
-
-
From zooreg
-
-
-# Start
-head ( q10_quarterly_zooreg )
-
## value
-## 2000 Q1 2329.0
-## 2000 Q2 2349.9
-## 2000 Q3 2332.9
-## 2000 Q4 2381.5
-## 2001 Q1 2382.6
-## 2001 Q2 2405.0
-
Notice that the index is a regularized numeric sequence by
-default.
-
-# End - with default regularized index
-tk_tbl ( q10_quarterly_zooreg )
-
## # A tibble: 59 x 2
-## index value
-## <yearqtr> <dbl>
-## 1 2000 Q1 2 329
-## 2 2000 Q2 2 350.
-## 3 2000 Q3 2 333.
-## 4 2000 Q4 2 382.
-## 5 2001 Q1 2 383.
-## 6 2001 Q2 2 405
-## 7 2001 Q3 2 411
-## 8 2001 Q4 2 428.
-## 9 2002 Q1 2 392.
-## 10 2002 Q2 2 418.
-## # i 49 more rows
-
With timetk_idx = TRUE
the index is the original date
-sequence. The result is the original tbl
that we started
-with!
-
-# End - with timetk index that is the same as original time-based index
-tk_tbl ( q10_quarterly_zooreg , timetk_idx = TRUE )
-
## # A tibble: 59 x 2
-## index value
-## <date> <dbl>
-## 1 2000-01-01 2 329
-## 2 2000-04-01 2 350.
-## 3 2000-07-01 2 333.
-## 4 2000-10-01 2 382.
-## 5 2001-01-01 2 383.
-## 6 2001-04-01 2 405
-## 7 2001-07-01 2 411
-## 8 2001-10-01 2 428.
-## 9 2002-01-01 2 392.
-## 10 2002-04-01 2 418.
-## # i 49 more rows
-
-
-
From ts
-
-
-# Start
-q10_quarterly_ts
-
## Qtr1 Qtr2 Qtr3 Qtr4
-## 2000 2329.0 2349.9 2332.9 2381.5
-## 2001 2382.6 2405.0 2411.0 2428.5
-## 2002 2391.6 2418.5 2406.5 2418.5
-## 2003 2420.4 2438.6 2448.7 2470.6
-## 2004 2484.5 2495.9 2492.5 2521.6
-## 2005 2538.1 2549.7 2587.2 2585.0
-## 2006 2602.6 2615.3 2654.0 2680.8
-## 2007 2665.4 2645.1 2647.5 2719.2
-## 2008 2677.0 2650.9 2667.8 2660.2
-## 2009 2554.7 2522.7 2510.0 2541.7
-## 2010 2499.1 2527.9 2519.0 2536.3
-## 2011 2493.2 2542.1 2501.6 2516.3
-## 2012 2510.5 2548.4 2548.6 2530.7
-## 2013 2497.1 2520.4 2516.9 2505.5
-## 2014 2513.9 2549.9 2555.3
-
Notice that the index is a regularized numeric sequence by
-default.
-
-# End - with default regularized index
-tk_tbl ( q10_quarterly_ts )
-
## # A tibble: 59 x 2
-## index value
-## <yearqtr> <dbl>
-## 1 2000 Q1 2 329
-## 2 2000 Q2 2 350.
-## 3 2000 Q3 2 333.
-## 4 2000 Q4 2 382.
-## 5 2001 Q1 2 383.
-## 6 2001 Q2 2 405
-## 7 2001 Q3 2 411
-## 8 2001 Q4 2 428.
-## 9 2002 Q1 2 392.
-## 10 2002 Q2 2 418.
-## # i 49 more rows
-
With timetk_idx = TRUE
the index is the original date
-sequence. The result is the original tbl
that we started
-with!
-
-# End - with timetk index
-tk_tbl ( q10_quarterly_ts , timetk_idx = TRUE )
-
## # A tibble: 59 x 2
-## index value
-## <date> <dbl>
-## 1 2000-01-01 2 329
-## 2 2000-04-01 2 350.
-## 3 2000-07-01 2 333.
-## 4 2000-10-01 2 382.
-## 5 2001-01-01 2 383.
-## 6 2001-04-01 2 405
-## 7 2001-07-01 2 411
-## 8 2001-10-01 2 428.
-## 9 2002-01-01 2 392.
-## 10 2002-04-01 2 418.
-## # i 49 more rows
-
-
-
-
-
Testing if an object has a timetk index
-
-
The function has_timetk_idx()
can be used to test
-whether toggling the timetk_idx
argument in the
-tk_index()
and tk_tbl()
functions will have an
-effect on the output. Here are several examples using the ten year
-treasury data used in the case study:
-
-
tk_ts()
-
-
The tk_ts()
function returns an object with the “timetk
-index” attribute.
-
-# Data coerced with tk_ts() has timetk index
-has_timetk_idx ( q10_quarterly_ts )
-
## [1] TRUE
-
If we toggle timetk_idx = TRUE
when retrieving the index
-with tk_index()
, we get the index of dates rather than the
-regularized time series.
-
-tk_index ( q10_quarterly_ts , timetk_idx = TRUE )
-
## [1] "2000-01-01" "2000-04-01" "2000-07-01" "2000-10-01" "2001-01-01"
-## [6] "2001-04-01" "2001-07-01" "2001-10-01" "2002-01-01" "2002-04-01"
-## [11] "2002-07-01" "2002-10-01" "2003-01-01" "2003-04-01" "2003-07-01"
-## [16] "2003-10-01" "2004-01-01" "2004-04-01" "2004-07-01" "2004-10-01"
-## [21] "2005-01-01" "2005-04-01" "2005-07-01" "2005-10-01" "2006-01-01"
-## [26] "2006-04-01" "2006-07-01" "2006-10-01" "2007-01-01" "2007-04-01"
-## [31] "2007-07-01" "2007-10-01" "2008-01-01" "2008-04-01" "2008-07-01"
-## [36] "2008-10-01" "2009-01-01" "2009-04-01" "2009-07-01" "2009-10-01"
-## [41] "2010-01-01" "2010-04-01" "2010-07-01" "2010-10-01" "2011-01-01"
-## [46] "2011-04-01" "2011-07-01" "2011-10-01" "2012-01-01" "2012-04-01"
-## [51] "2012-07-01" "2012-10-01" "2013-01-01" "2013-04-01" "2013-07-01"
-## [56] "2013-10-01" "2014-01-01" "2014-04-01" "2014-07-01"
-
If we toggle timetk_idx = TRUE
during conversion to
-tbl
using tk_tbl()
, we get the index of dates
-rather than the regularized index in the returned tbl
.
-
-tk_tbl ( q10_quarterly_ts , timetk_idx = TRUE )
-
## # A tibble: 59 x 2
-## index value
-## <date> <dbl>
-## 1 2000-01-01 2 329
-## 2 2000-04-01 2 350.
-## 3 2000-07-01 2 333.
-## 4 2000-10-01 2 382.
-## 5 2001-01-01 2 383.
-## 6 2001-04-01 2 405
-## 7 2001-07-01 2 411
-## 8 2001-10-01 2 428.
-## 9 2002-01-01 2 392.
-## 10 2002-04-01 2 418.
-## # i 49 more rows
-
-
-
Testing other data types
-
-
The timetk_idx
argument will only have an effect on
-objects that use regularized time series. Therefore,
-has_timetk_idx()
returns FALSE
for other
-object types (e.g. tbl
, xts
, zoo
)
-since toggling the argument has no effect on these classes.
-
-
## [1] FALSE
-
Toggling the timetk_idx
argument has no effect on the
-output. Output with timetk_idx = TRUE
is the same as with
-timetk_idx = FALSE
.
-
-tk_index ( q10_quarterly_xts , timetk_idx = TRUE )
-
## [1] "2000-01-01" "2000-04-01" "2000-07-01" "2000-10-01" "2001-01-01"
-## [6] "2001-04-01" "2001-07-01" "2001-10-01" "2002-01-01" "2002-04-01"
-## [11] "2002-07-01" "2002-10-01" "2003-01-01" "2003-04-01" "2003-07-01"
-## [16] "2003-10-01" "2004-01-01" "2004-04-01" "2004-07-01" "2004-10-01"
-## [21] "2005-01-01" "2005-04-01" "2005-07-01" "2005-10-01" "2006-01-01"
-## [26] "2006-04-01" "2006-07-01" "2006-10-01" "2007-01-01" "2007-04-01"
-## [31] "2007-07-01" "2007-10-01" "2008-01-01" "2008-04-01" "2008-07-01"
-## [36] "2008-10-01" "2009-01-01" "2009-04-01" "2009-07-01" "2009-10-01"
-## [41] "2010-01-01" "2010-04-01" "2010-07-01" "2010-10-01" "2011-01-01"
-## [46] "2011-04-01" "2011-07-01" "2011-10-01" "2012-01-01" "2012-04-01"
-## [51] "2012-07-01" "2012-10-01" "2013-01-01" "2013-04-01" "2013-07-01"
-## [56] "2013-10-01" "2014-01-01" "2014-04-01" "2014-07-01"
-
-
-
-
Working with zoo::yearmon and zoo::yearqtr index
-
-
The zoo
package has the yearmon
and
-yearqtr
classes for working with regularized monthly and
-quarterly data, respectively. The “timetk index” tracks the format
-during conversion. Here’s and example with yearqtr
.
-
-
## # A tibble: 59 x 3
-## id date value
-## <fct> <yearqtr> <dbl>
-## 1 Q10 2000 Q1 2 329
-## 2 Q10 2000 Q2 2 350.
-## 3 Q10 2000 Q3 2 333.
-## 4 Q10 2000 Q4 2 382.
-## 5 Q10 2001 Q1 2 383.
-## 6 Q10 2001 Q2 2 405
-## 7 Q10 2001 Q3 2 411
-## 8 Q10 2001 Q4 2 428.
-## 9 Q10 2002 Q1 2 392.
-## 10 Q10 2002 Q2 2 418.
-## # i 49 more rows
-
We can coerce to xts
and the yearqtr
class
-is intact.
-
-yearqtr_xts <- tk_xts ( yearqtr_tbl )
-
## Warning: Non-numeric columns being dropped: id, date
-
## Using column `date` for date_var.
-
-
## value
-## 2000 Q1 2329.0
-## 2000 Q2 2349.9
-## 2000 Q3 2332.9
-## 2000 Q4 2381.5
-## 2001 Q1 2382.6
-## 2001 Q2 2405.0
-
We can coerce to ts
and, although the “timetk index” is
-hidden, the yearqtr
class is intact.
-
-yearqtr_ts <- tk_ts ( yearqtr_xts , start = 1997 , freq = 4 )
-yearqtr_ts %>% head ( )
-
## value
-## [1,] 2329.0
-## [2,] 2349.9
-## [3,] 2332.9
-## [4,] 2381.5
-## [5,] 2382.6
-## [6,] 2405.0
-
Coercing from ts
to tbl
using
-timetk_idx = TRUE
shows that the original index was
-maintained through each of the conversion steps.
-
-
## # A tibble: 59 x 2
-## index value
-## <yearqtr> <dbl>
-## 1 2000 Q1 2 329
-## 2 2000 Q2 2 350.
-## 3 2000 Q3 2 333.
-## 4 2000 Q4 2 382.
-## 5 2001 Q1 2 383.
-## 6 2001 Q2 2 405
-## 7 2001 Q3 2 411
-## 8 2001 Q4 2 428.
-## 9 2002 Q1 2 392.
-## 10 2002 Q2 2 418.
-## # i 49 more rows
-
-
-
Learning More
-
-
-VIDEO
-
-
-
My Talk on High-Performance Time Series Forecasting
-
Time series is changing. Businesses now need 10,000+ time
-series forecasts every day.
-
High-Performance Forecasting Systems will save companies
-MILLIONS of dollars. Imagine what will happen to your career if
-you can provide your organization a “High-Performance Time Series
-Forecasting System” (HPTSF System).
-
I teach how to build a HPTFS System in my High-Performance
-Time Series Forecasting Course . If interested in learning
-Scalable High-Performance Forecasting Strategies then take
-my course . You will learn:
-
-Time Series Machine Learning (cutting-edge) with
-Modeltime
- 30+ Models (Prophet, ARIMA, XGBoost, Random
-Forest, & many more)
-NEW - Deep Learning with GluonTS
(Competition
-Winners)
-Time Series Preprocessing, Noise Reduction, & Anomaly
-Detection
-Feature engineering using lagged variables & external
-regressors
-Hyperparameter Tuning
-Time series cross-validation
-Ensembling Multiple Machine Learning & Univariate Modeling
-Techniques (Competition Winner)
-Scalable Forecasting - Forecast 1000+ time series in parallel
-and more.
-
-
-Unlock
-the High-Performance Time Series Forecasting Course
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/docs/articles/TK01_Working_With_Time_Series_Index.html b/docs/articles/TK01_Working_With_Time_Series_Index.html
deleted file mode 100644
index 4a8d4613..00000000
--- a/docs/articles/TK01_Working_With_Time_Series_Index.html
+++ /dev/null
@@ -1,602 +0,0 @@
-
-
-
-
-
-
-
-
-Calendar Features • timetk
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Skip to contents
-
-
-
-
-
timetk
-
-
2.8.4
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-This vignette covers making and working with Calendar
-Features , which are derived from a time series index, or the
-sequence of date/datetime stamps that accompany time series data.
-
-
Introduction
-
-
The time series index consists of a collection of
-time-based values that define when each observation occurred,
-is the most important part of a time series object.
-
The index gives the user a lot of information in a simple timestamp.
-Consider the datetime “2016-01-01
-00:00:00” .
-
From this timestamp, we can decompose the date and time information
-to get the signature , which consists of the year,
-quarter, month, day, day of year, day of month, hour, minute, and second
-of the occurrence of a single observation. Further, the difference
-between two or more observations is the frequency from
-which we can obtain even more information such as the periodicity of the
-data and whether or not these observations are on a regular interval.
-This information is critical as it provides the basis for performance
-over time in finance, decay rates in biology, growth rates in economics,
-and so on.
-
In this vignette the user will be exposed to:
-
-Time Series Index
-Time Series Signature
-Time Series Summary
-
-
-
-
Prerequisites
-
-
Before we get started, load the following packages.
-
-
-
-
Data
-
-
We’ll use the Facebook stock prices from the FANG
data
-set. These are the historical stock prices (open, high, low, close,
-volume, and adjusted) for the “FB” stock from 2013 through 2016.
-
-data ( "FANG" )
-
-FB_tbl <- FANG %>% filter ( symbol == "FB" )
-FB_tbl
-
## # A tibble: 1,008 x 8
-## symbol date open high low close volume adjusted
-## <chr> <date> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
-## 1 FB 2013-01-02 27.4 28.2 27.4 28 69846 400 28
-## 2 FB 2013-01-03 27.9 28.5 27.6 27.8 63140 600 27.8
-## 3 FB 2013-01-04 28.0 28.9 27.8 28.8 72715 400 28.8
-## 4 FB 2013-01-07 28.7 29.8 28.6 29.4 83781 800 29.4
-## 5 FB 2013-01-08 29.5 29.6 28.9 29.1 45871 300 29.1
-## 6 FB 2013-01-09 29.7 30.6 29.5 30.6 104787 700 30.6
-## 7 FB 2013-01-10 30.6 31.5 30.3 31.3 95316 400 31.3
-## 8 FB 2013-01-11 31.3 32.0 31.1 31.7 89598 000 31.7
-## 9 FB 2013-01-14 32.1 32.2 30.6 31.0 98892 800 31.0
-## 10 FB 2013-01-15 30.6 31.7 29.9 30.1 173242 600 30.1
-## # i 998 more rows
-
To simplify the tutorial, we will select only the “date” and “volume”
-columns. For the FB_vol_date
data frame, we can see from
-the “date” column that the observations are daily beginning on
-the second day of 2013.
-
-FB_vol_date <- FB_tbl %>% select ( date , volume )
-FB_vol_date
-
## # A tibble: 1,008 x 2
-## date volume
-## <date> <dbl>
-## 1 2013-01-02 69846 400
-## 2 2013-01-03 63140 600
-## 3 2013-01-04 72715 400
-## 4 2013-01-07 83781 800
-## 5 2013-01-08 45871 300
-## 6 2013-01-09 104787 700
-## 7 2013-01-10 95316 400
-## 8 2013-01-11 89598 000
-## 9 2013-01-14 98892 800
-## 10 2013-01-15 173242 600
-## # i 998 more rows
-
-
-
Time Series Index
-
-
Before we can analyze an index, we need to extract it from the
-object. The function tk_index()
extracts the index from any
-time series object including data frame (or tbl
),
-xts
, zoo
, etc. The index is always returned in
-the native date, datetime, yearmon, or yearqtr format. Note that the
-index must be in one of these time-based classes for extraction to
-work:
-
-datetimes: Must inherit POSIXt
-
-dates: Must inherit Date
-
-yearmon: Must inherit yearmon
from the zoo
-package
-yearqtr: Must inherit yearqtr
from the zoo
-package
-
-
Extract the index using tk_index()
. The structure is
-shown to see the output format, which is a vector of dates.
-
-# idx_date
-idx_date <- tk_index ( FB_vol_date )
-str ( idx_date )
-
## Date[1:1008], format: "2013-01-02" "2013-01-03" "2013-01-04" "2013-01-07" "2013-01-08" ...
-
-
-
Time Series Signature
-
-
The index can be decomposed into a signature . The time
-series signature is a unique set of properties of the time series values
-that describe the time series.
-
-
-
The function tk_get_timeseries_signature()
can be used
-to convert the index to a tibble containing the following values
-(columns):
-
-
-index : The index value that was decomposed
-
-index.num : The numeric value of the index in
-seconds. The base is “1970-01-01 00:00:00” (Execute
-"1970-01-01 00:00:00" %>% ymd_hms() %>% as.numeric()
-to see the value returned is zero). Every time series value after this
-date can be converted to a numeric value in seconds.
-
-diff : The difference in seconds from the previous
-numeric index value.
-
-year : The year component of the index.
-
-year.iso : The ISO year number of the year (Monday
-start).
-
-half : The half component of the index.
-
-quarter : The quarter component of the index.
-
-month : The month component of the index with base
-1.
-
-month.xts : The month component of the index with
-base 0, which is what xts
implements.
-
-month.lbl : The month label as an ordered factor
-begining with January and ending with December.
-
-day : The day component of the index.
-
-hour : The hour component of the index.
-
-minute : The minute component of the index.
-
-second : The second component of the index.
-
-hour12 : The hour component on a 12 hour scale.
-
-am.pm : Morning (AM) = 1, Afternoon (PM) = 2.
-
-wday : The day of the week with base 1. Sunday = 1
-and Saturday = 7.
-
-wday.xts : The day of the week with base 0, which is
-what xts
implements. Sunday = 0 and Saturday = 6.
-
-wday.lbl : The day of the week label as an ordered
-factor begining with Sunday and ending with Saturday.
-
-mday : The day of the month.
-
-qday : The day of the quarter.
-
-yday : The day of the year.
-
-mweek : The week of the month.
-
-week : The week number of the year (Sunday
-start).
-
-week.iso : The ISO week number of the year (Monday
-start).
-
-week2 : The modulus for bi-weekly frequency.
-
-week3 : The modulus for tri-weekly frequency.
-
-week4 : The modulus for quad-weekly frequency.
-
-mday7 : The integer division of day of the month by
-seven, which returns the first, second, third, … instance the day has
-appeared in the month. Values begin at 1. For example, the first
-Saturday in the month has mday7 = 1. The second has mday7 = 2.
-
-
-
## # A tibble: 1,008 x 29
-## index index.num diff year year.iso half quarter month month.xts
-## <date> <dbl> <dbl> <int> <int> <int> <int> <int> <int>
-## 1 2013-01-02 1 357084 800 NA 2 013 2 013 1 1 1 0
-## 2 2013-01-03 1 357171 200 86 400 2 013 2 013 1 1 1 0
-## 3 2013-01-04 1 357257 600 86 400 2 013 2 013 1 1 1 0
-## 4 2013-01-07 1 357516 800 259 200 2 013 2 013 1 1 1 0
-## 5 2013-01-08 1 357603 200 86 400 2 013 2 013 1 1 1 0
-## 6 2013-01-09 1 357689 600 86 400 2 013 2 013 1 1 1 0
-## 7 2013-01-10 1 357776 000 86 400 2 013 2 013 1 1 1 0
-## 8 2013-01-11 1 357862 400 86 400 2 013 2 013 1 1 1 0
-## 9 2013-01-14 1 358121 600 259 200 2 013 2 013 1 1 1 0
-## 10 2013-01-15 1 358208 000 86 400 2 013 2 013 1 1 1 0
-## # i 998 more rows
-## # i 20 more variables: month.lbl <ord>, day <int>, hour <int>, minute <int>,
-## # second <int>, hour12 <int>, am.pm <int>, wday <int>, wday.xts <int>,
-## # wday.lbl <ord>, mday <int>, qday <int>, yday <int>, mweek <int>,
-## # week <int>, week.iso <int>, week2 <int>, week3 <int>, week4 <int>,
-## # mday7 <int>
-
-
-
Augment Functions (Adding Many Features to a Data Frame)
-
-
It’s usually important to keep the index signature with the values
-(e.g. volume in our example). We can use an expedited approach with
-tk_augment_timeseries_signature()
, which adds the signature
-to the end of the time series object.
-
-
## # A tibble: 1,008 x 30
-## date volume index.num diff year year.iso half quarter month
-## <date> <dbl> <dbl> <dbl> <int> <int> <int> <int> <int>
-## 1 2013-01-02 69846 400 1 357084 800 NA 2 013 2 013 1 1 1
-## 2 2013-01-03 63140 600 1 357171 200 86 400 2 013 2 013 1 1 1
-## 3 2013-01-04 72715 400 1 357257 600 86 400 2 013 2 013 1 1 1
-## 4 2013-01-07 83781 800 1 357516 800 259 200 2 013 2 013 1 1 1
-## 5 2013-01-08 45871 300 1 357603 200 86 400 2 013 2 013 1 1 1
-## 6 2013-01-09 104787 700 1 357689 600 86 400 2 013 2 013 1 1 1
-## 7 2013-01-10 95316 400 1 357776 000 86 400 2 013 2 013 1 1 1
-## 8 2013-01-11 89598 000 1 357862 400 86 400 2 013 2 013 1 1 1
-## 9 2013-01-14 98892 800 1 358121 600 259 200 2 013 2 013 1 1 1
-## 10 2013-01-15 173242 600 1 358208 000 86 400 2 013 2 013 1 1 1
-## # i 998 more rows
-## # i 21 more variables: month.xts <int>, month.lbl <ord>, day <int>, hour <int>,
-## # minute <int>, second <int>, hour12 <int>, am.pm <int>, wday <int>,
-## # wday.xts <int>, wday.lbl <ord>, mday <int>, qday <int>, yday <int>,
-## # mweek <int>, week <int>, week.iso <int>, week2 <int>, week3 <int>,
-## # week4 <int>, mday7 <int>
-
Modeling is now much easier. As an example, we can use linear
-regression model using the lm()
function with the month and
-year as a predictor of volume.
-
-# Example Benefit 2: Modeling is easier
-fit <- lm ( volume ~ year + month.lbl , data = FB_vol_date_signature )
-summary ( fit )
-
##
-## Call:
-## lm(formula = volume ~ year + month.lbl, data = FB_vol_date_signature)
-##
-## Residuals:
-## Min 1Q Median 3Q Max
-## -51042223 -13528407 -4588594 8296073 304011277
-##
-## Coefficients:
-## Estimate Std. Error t value Pr(>|t|)
-## (Intercept) 2.494e+10 1.414e+09 17.633 < 2e-16 ***
-## year -1.236e+07 7.021e+05 -17.604 < 2e-16 ***
-## month.lbl.L -9.589e+06 2.740e+06 -3.499 0.000488 ***
-## month.lbl.Q 7.348e+06 2.725e+06 2.697 0.007122 **
-## month.lbl.C -9.773e+06 2.711e+06 -3.605 0.000328 ***
-## month.lbl^4 -2.885e+06 2.720e+06 -1.060 0.289176
-## month.lbl^5 -2.994e+06 2.749e+06 -1.089 0.276428
-## month.lbl^6 3.169e+06 2.753e+06 1.151 0.249851
-## month.lbl^7 6.000e+05 2.721e+06 0.221 0.825514
-## month.lbl^8 8.281e+03 2.702e+06 0.003 0.997555
-## month.lbl^9 9.504e+06 2.704e+06 3.515 0.000459 ***
-## month.lbl^10 -5.911e+06 2.701e+06 -2.188 0.028888 *
-## month.lbl^11 -4.738e+06 2.696e+06 -1.757 0.079181 .
-## ---
-## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
-##
-## Residual standard error: 24910000 on 995 degrees of freedom
-## Multiple R-squared: 0.2714, Adjusted R-squared: 0.2626
-## F-statistic: 30.89 on 12 and 995 DF, p-value: < 2.2e-16
-
-
-
-
Time Series Summary
-
-
The next index analysis tool is the summary metrics, which can be
-retrieved using the tk_get_timeseries_summary()
function.
-The summary reports the following attributes as a single-row tibble.
-
General Summary :
-
The first six columns are general summary information.
-
-
-n.obs : The total number of observations
-
-start : The start in the appropriate time class
-
-end : The end in the appropriate time class
-
-units : A label that describes the unit of the index
-value that is independent of frequency (i.e. a date class will always be
-“days” whereas a datetime class will always be “seconds”). Values can be
-days, hours, mins, secs.
-
-scale : A label that describes the the median
-difference (frequency) between observations. Values can be quarter,
-month, day, hour, minute, second.
-
-tzone : The timezone of the index.
-
-
-
## # A tibble: 1 x 6
-## n.obs start end units scale tzone
-## <int> <date> <date> <chr> <chr> <chr>
-## 1 1 008 2013-01-02 2016-12-30 days day UTC
-
Differences Summary :
-
The next group of values are the differences summary
-(i.e. summary of frequency). All values are in seconds:
-
-
-diff.minimum : The minimum difference between index
-values.
-
-diff.q1 : The first quartile of the index
-differences.
-
-diff.median : The median difference between index
-values (i.e. most common frequency).
-
-diff.mean : The average difference between index
-values.
-
-diff.q3 : The third quartile of the index
-differences.
-
-diff.maximum : The maximum difference between index
-values.
-
-
-
## # A tibble: 1 x 6
-## diff.minimum diff.q1 diff.median diff.mean diff.q3 diff.maximum
-## <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
-## 1 86 400 86 400 86 400 125 096. 86 400 345 600
-
The differences provide information about the
-regularity of the frequency . Generally speaking if all
-difference values are equal, the index is regular. However, scales
-beyond “day” are never theoretically regular since the differences in
-seconds are not equivalent. However, conceptually monthly, quarterly and
-yearly data can be thought of as regular if the index contains
-consecutive months, quarters, or years, respectively. Therefore, the
-difference attributes are most meaningful for daily and lower time
-scales because the difference summary always indicates level of
-regularity.
-
From the second group (differences summary), we immediately recognize
-that the mean is different than the median and therefore the index is
-irregular (meaning certain days are missing). Further we can
-see that the maximum difference is 345,600 seconds, indicating the
-maximum difference is 4 days (345,600 seconds / 86400 seconds/day).
-
-
-
Learning More
-
-
-VIDEO
-
-
-
My Talk on High-Performance Time Series Forecasting
-
Time series is changing. Businesses now need 10,000+ time
-series forecasts every day.
-
High-Performance Forecasting Systems will save companies
-MILLIONS of dollars. Imagine what will happen to your career if
-you can provide your organization a “High-Performance Time Series
-Forecasting System” (HPTSF System).
-
I teach how to build a HPTFS System in my High-Performance
-Time Series Forecasting Course . If interested in learning
-Scalable High-Performance Forecasting Strategies then take
-my course . You will learn:
-
-Time Series Machine Learning (cutting-edge) with
-Modeltime
- 30+ Models (Prophet, ARIMA, XGBoost, Random
-Forest, & many more)
-NEW - Deep Learning with GluonTS
(Competition
-Winners)
-Time Series Preprocessing, Noise Reduction, & Anomaly
-Detection
-Feature engineering using lagged variables & external
-regressors
-Hyperparameter Tuning
-Time series cross-validation
-Ensembling Multiple Machine Learning & Univariate Modeling
-Techniques (Competition Winner)
-Scalable Forecasting - Forecast 1000+ time series in parallel
-and more.
-
-
-Unlock
-the High-Performance Time Series Forecasting Course
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/docs/articles/TK02_Time_Series_Date_Sequences.html b/docs/articles/TK02_Time_Series_Date_Sequences.html
deleted file mode 100644
index 66d87432..00000000
--- a/docs/articles/TK02_Time_Series_Date_Sequences.html
+++ /dev/null
@@ -1,377 +0,0 @@
-
-
-
-
-
-
-
-
-Intelligent Date & Time Sequences • timetk
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Skip to contents
-
-
-
-
-
timetk
-
-
2.8.4
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Creating and modifying date sequences is critical to
-machine learning projects. We discuss:
-
-
-
Prerequisites
-
-
Before we get started, load the following packages.
-
-
-
-
Making a Time Series Sequence
-
-
tk_make_timeseries()
improves on the
-seq.Date()
and seq.POSIXt()
functions by
-simplifying into 1 function. Intelligently handles character dates and
-logical assumptions based on user inputs.
-
By Day
-
-Can use by = "day"
or leave blank.
-
-include_endpoints = FALSE
removes the last value so
-your series is only 7 observations.
-
-
-# Selects by day automatically
-tk_make_timeseries ( "2011" , length_out = "7 days" , include_endpoints = FALSE )
-
## [1] "2011-01-01" "2011-01-02" "2011-01-03" "2011-01-04" "2011-01-05"
-## [6] "2011-01-06" "2011-01-07"
-
By 2 Seconds
-
-Can use by = "2 sec"
to adjust the interval width.
-
-include_endpoints = TRUE
keeps the last value the
-series ends on the 6th second.
-
-
-
## [1] "2016-01-01 00:00:00 UTC" "2016-01-01 00:00:02 UTC"
-## [3] "2016-01-01 00:00:04 UTC" "2016-01-01 00:00:06 UTC"
-
Length Out = 1 year 6 months
-
-
-length_out = "1 year 6 months"
- Can include complex
-expressions like “1 year 4 months 6 days”.
-
-
-tk_make_timeseries ( "2012-07" ,
- by = "1 month" ,
- length_out = "1 year 6 months" ,
- include_endpoints = FALSE )
-
## [1] "2012-07-01" "2012-08-01" "2012-09-01" "2012-10-01" "2012-11-01"
-## [6] "2012-12-01" "2013-01-01" "2013-02-01" "2013-03-01" "2013-04-01"
-## [11] "2013-05-01" "2013-06-01" "2013-07-01" "2013-08-01" "2013-09-01"
-## [16] "2013-10-01" "2013-11-01" "2013-12-01"
-
Go In Reverse
-
-To go in reverse, just use end_date
as where you want
-the series to end.
-
-
-tk_make_timeseries ( end_date = "2012-07-01" ,
- by = "1 month" ,
- length_out = "1 year 6 months" )
-
## [1] "2011-01-01" "2011-02-01" "2011-03-01" "2011-04-01" "2011-05-01"
-## [6] "2011-06-01" "2011-07-01" "2011-08-01" "2011-09-01" "2011-10-01"
-## [11] "2011-11-01" "2011-12-01" "2012-01-01" "2012-02-01" "2012-03-01"
-## [16] "2012-04-01" "2012-05-01" "2012-06-01" "2012-07-01"
-
-
-
Future Time Series Sequence
-
-
A common operation is to make a future time series sequence that
-mimics an existing. This is what
-tk_make_future_timeseries()
is for.
-
Suppose we have an existing time index.
-
-idx <- tk_make_timeseries ( "2012" , by = "3 months" ,
- length_out = "2 years" ,
- include_endpoints = FALSE )
-idx
-
## [1] "2012-01-01" "2012-04-01" "2012-07-01" "2012-10-01" "2013-01-01"
-## [6] "2013-04-01" "2013-07-01" "2013-10-01"
-
Make a Future Time Series from an Existing
-
We can create a future time sequence from the existing sequence using
-tk_make_future_timeseries()
.
-
-
## [1] "2014-01-01" "2014-04-01" "2014-07-01" "2014-10-01" "2015-01-01"
-## [6] "2015-04-01" "2015-07-01" "2015-10-01"
-
-
-
Weekends & Holidays
-
-
Make weekday sequence removing holidays
-
-
-
## # A tibble: 1 x 12
-## n.obs start end units scale tzone diff.minimum diff.q1 diff.median
-## <int> <date> <date> <chr> <chr> <chr> <dbl> <dbl> <dbl>
-## 1 250 2012-01-03 2012-12-31 days day UTC 86 400 86 400 86 400
-## # i 3 more variables: diff.mean <dbl>, diff.q3 <dbl>, diff.maximum <dbl>
-
Which holidays were removed?
-
-NYSE Trading holidays which are days most businesses observe
-
-
-
## [1] "2012-01-02" "2012-01-16" "2012-02-20" "2012-04-06" "2012-05-28"
-## [6] "2012-07-04" "2012-09-03" "2012-10-29" "2012-10-30" "2012-11-22"
-## [11] "2012-12-25"
-
Make future index removing holidays
-
-
## # A tibble: 1 x 12
-## n.obs start end units scale tzone diff.minimum diff.q1 diff.median
-## <int> <date> <date> <chr> <chr> <chr> <dbl> <dbl> <dbl>
-## 1 252 2013-01-02 2013-12-31 days day UTC 86 400 86 400 86 400
-## # i 3 more variables: diff.mean <dbl>, diff.q3 <dbl>, diff.maximum <dbl>
-
-
-
Learning More
-
-
-VIDEO
-
-
-
My Talk on High-Performance Time Series Forecasting
-
Time series is changing. Businesses now need 10,000+ time
-series forecasts every day.
-
High-Performance Forecasting Systems will save companies
-MILLIONS of dollars. Imagine what will happen to your career if
-you can provide your organization a “High-Performance Time Series
-Forecasting System” (HPTSF System).
-
I teach how to build a HPTFS System in my High-Performance
-Time Series Forecasting Course . If interested in learning
-Scalable High-Performance Forecasting Strategies then take
-my course . You will learn:
-
-Time Series Machine Learning (cutting-edge) with
-Modeltime
- 30+ Models (Prophet, ARIMA, XGBoost, Random
-Forest, & many more)
-NEW - Deep Learning with GluonTS
(Competition
-Winners)
-Time Series Preprocessing, Noise Reduction, & Anomaly
-Detection
-Feature engineering using lagged variables & external
-regressors
-Hyperparameter Tuning
-Time series cross-validation
-Ensembling Multiple Machine Learning & Univariate Modeling
-Techniques (Competition Winner)
-Scalable Forecasting - Forecast 1000+ time series in parallel
-and more.
-
-
-Unlock
-the High-Performance Time Series Forecasting Course
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/docs/articles/TK03_Forecasting_Using_Time_Series_Signature.html b/docs/articles/TK03_Forecasting_Using_Time_Series_Signature.html
deleted file mode 100644
index 93d585ee..00000000
--- a/docs/articles/TK03_Forecasting_Using_Time_Series_Signature.html
+++ /dev/null
@@ -1,1099 +0,0 @@
-
-
-
-
-
-
-
-
-Time Series Machine Learning • timetk
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Skip to contents
-
-
-
-
-
timetk
-
-
2.8.4
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-This vignette covers Machine Learning for
-Forecasting using the time-series signature , a
-collection calendar features derived from the timestamps in the time
-series.
-
-
Introduction
-
-
The time series signature is a collection of useful features that
-describe the time series index of a time-based data set. It contains a
-wealth of features that can be used to forecast time series that contain
-patterns.
-
In this vignette, the user will learn methods to implement machine
-learning to predict future outcomes in a time-based data set. The
-vignette example uses a well known time series dataset, the Bike Sharing
-Dataset, from the UCI Machine Learning Repository. The vignette follows
-an example where we’ll use timetk
to build a basic Machine
-Learning model to predict future values using the time series signature.
-The objective is to build a model and predict the next six months of
-Bike Sharing daily counts.
-
-
-
Prerequisites
-
-
Before we get started, load the following packages.
-
-
-
-
Data
-
-
We’ll be using the Bike
-Sharing Dataset from the UCI Machine Learning Repository.
-
Source: Fanaee-T, Hadi, and Gama, Joao, ‘Event labeling combining
-ensemble detectors and background knowledge’, Progress in Artificial
-Intelligence (2013): pp. 1-15, Springer Berlin Heidelberg
-
-# Read data
-bike_transactions_tbl <- bike_sharing_daily %>%
- select ( dteday , cnt ) %>%
- set_names ( c ( "date" , "value" ) )
-
-bike_transactions_tbl
-
## # A tibble: 731 x 2
-## date value
-## <date> <dbl>
-## 1 2011-01-01 985
-## 2 2011-01-02 801
-## 3 2011-01-03 1 349
-## 4 2011-01-04 1 562
-## 5 2011-01-05 1 600
-## 6 2011-01-06 1 606
-## 7 2011-01-07 1 510
-## 8 2011-01-08 959
-## 9 2011-01-09 822
-## 10 2011-01-10 1 321
-## # i 721 more rows
-
Next, visualize the dataset with the plot_time_series()
-function. Toggle .interactive = TRUE
to get a plotly
-interactive plot. FALSE
returns a ggplot2 static plot.
-
-
-
-
-
Train / Test
-
-
Next, use time_series_split()
to make a train/test
-set.
-
-Setting assess = "3 months"
tells the function to use
-the last 3-months of data as the testing set.
-Setting cumulative = TRUE
tells the sampling to use all
-of the prior data as the training set.
-
-
-
Next, visualize the train/test split.
-
-
-
-
-
-
Modeling
-
-
Machine learning models are more complex than univariate models
-(e.g. ARIMA, Exponential Smoothing). This complexity typically requires
-a workflow (sometimes called a
-pipeline in other languages). The general process goes like
-this:
-
-Create Preprocessing Recipe
-Create Model Specifications
-Use Workflow to combine Model Spec and Preprocessing, and
-Fit Model
-
-
-
Recipe Preprocessing Specification
-
-
The first step is to add the time series signature to the
-training set, which will be used this to learn the patterns. New in
-timetk
0.1.3 is integration with the recipes
R
-package:
-
-The recipes
package allows us to add preprocessing
-steps that are applied sequentially as part of a data transformation
-pipeline.
-The timetk
has
-step_timeseries_signature()
, which is used to add a number
-of features that can help machine learning models.
-
-
-
We can see what happens when we apply a prepared recipe
-prep()
using the bake()
function. Many new
-columns were added from the timestamp “date” feature. These are features
-we can use in our machine learning models.
-
-
## # A tibble: 641 x 29
-## date value date_index.num date_year date_year.iso date_half
-## <date> <dbl> <dbl> <int> <int> <int>
-## 1 2011-01-01 985 1 293840 000 2 011 2 010 1
-## 2 2011-01-02 801 1 293926 400 2 011 2 010 1
-## 3 2011-01-03 1 349 1 294012 800 2 011 2 011 1
-## 4 2011-01-04 1 562 1 294099 200 2 011 2 011 1
-## 5 2011-01-05 1 600 1 294185 600 2 011 2 011 1
-## 6 2011-01-06 1 606 1 294272 000 2 011 2 011 1
-## 7 2011-01-07 1 510 1 294358 400 2 011 2 011 1
-## 8 2011-01-08 959 1 294444 800 2 011 2 011 1
-## 9 2011-01-09 822 1 294531 200 2 011 2 011 1
-## 10 2011-01-10 1 321 1 294617 600 2 011 2 011 1
-## # i 631 more rows
-## # i 23 more variables: date_quarter <int>, date_month <int>,
-## # date_month.xts <int>, date_month.lbl <ord>, date_day <int>,
-## # date_hour <int>, date_minute <int>, date_second <int>, date_hour12 <int>,
-## # date_am.pm <int>, date_wday <int>, date_wday.xts <int>,
-## # date_wday.lbl <ord>, date_mday <int>, date_qday <int>, date_yday <int>,
-## # date_mweek <int>, date_week <int>, date_week.iso <int>, ...
-
Next, I apply various preprocessing steps to improve the modeling
-behavior. If you wish to learn more, I have an Advanced
-Time Series course that will help you learn these techniques.
-
-
## # A tibble: 641 x 47
-## value date_index.num date_year date_half date_quarter date_month date_day
-## <dbl> <dbl> <dbl> <int> <int> <int> <int>
-## 1 985 -1.73 -0.869 1 1 1 1
-## 2 801 -1.72 -0.869 1 1 1 2
-## 3 1 349 -1.72 -0.869 1 1 1 3
-## 4 1 562 -1.71 -0.869 1 1 1 4
-## 5 1 600 -1.71 -0.869 1 1 1 5
-## 6 1 606 -1.70 -0.869 1 1 1 6
-## 7 1 510 -1.70 -0.869 1 1 1 7
-## 8 959 -1.69 -0.869 1 1 1 8
-## 9 822 -1.68 -0.869 1 1 1 9
-## 10 1 321 -1.68 -0.869 1 1 1 10
-## # i 631 more rows
-## # i 40 more variables: date_second <int>, date_wday <int>, date_mday <int>,
-## # date_qday <int>, date_yday <int>, date_mweek <int>, date_week <int>,
-## # date_week2 <int>, date_week3 <int>, date_week4 <int>, date_mday7 <int>,
-## # date_sin365_K1 <dbl>, date_cos365_K1 <dbl>, date_sin365_K2 <dbl>,
-## # date_cos365_K2 <dbl>, date_sin365_K3 <dbl>, date_cos365_K3 <dbl>,
-## # date_sin365_K4 <dbl>, date_cos365_K4 <dbl>, date_sin365_K5 <dbl>, ...
-
-
-
Model Specification
-
-
Next, let’s create a model specification. We’ll use a Elastic Net
-penalized regression via the glmnet
package.
-
-model_spec_lm <- linear_reg (
- mode = "regression" ,
- penalty = 0.1
-) %>%
- set_engine ( "glmnet" )
-
-
-
Workflow
-
-
We can mary up the preprocessing recipe and the model using a
-workflow()
.
-
-workflow_lm <- workflow ( ) %>%
- add_recipe ( recipe_spec_final ) %>%
- add_model ( model_spec_lm )
-
-workflow_lm
-
## == Workflow ====================================================================
-## Preprocessor: Recipe
-## Model: linear_reg()
-##
-## -- Preprocessor ----------------------------------------------------------------
-## 6 Recipe Steps
-##
-## * step_timeseries_signature()
-## * step_fourier()
-## * step_rm()
-## * step_rm()
-## * step_normalize()
-## * step_dummy()
-##
-## -- Model -----------------------------------------------------------------------
-## Linear Regression Model Specification (regression)
-##
-## Main Arguments:
-## penalty = 0.1
-##
-## Computational engine: glmnet
-
-
-
Training
-
-
The workflow can be trained with the fit()
function.
-
-workflow_fit_lm <- workflow_lm %>% fit ( data = training ( splits ) )
-
-
-
Hyperparameter Tuning
-
-
Linear regression has no parameters. Therefore, this step is not
-needed. More complex models have hyperparameters that require tuning.
-Algorithms include:
-
-Elastic Net
-XGBoost
-Random Forest
-Support Vector Machine (SVM)
-K-Nearest Neighbors
-Multivariate Adaptive Regression Spines (MARS)
-
-
If you would like to learn how to tune these models for time series,
-then join the waitlist for my advanced Time
-Series Analysis & Forecasting Course .
-
-
-
-
Forecasting with Modeltime
-
-
The Modeltime Workflow is designed to speed up model
-evaluation and selection. Now that we have several time series models,
-let’s analyze them and forecast the future with the
-modeltime
package.
-
-
Modeltime Table
-
-
The Modeltime Table organizes the models with IDs
-and creates generic descriptions to help us keep track of our models.
-Let’s add the models to a modeltime_table()
.
-
-
## # Modeltime Table
-## # A tibble: 1 x 3
-## .model_id .model .model_desc
-## <int> <list> <chr>
-## 1 1 <workflow> GLMNET
-
-
-
Calibration
-
-
Model Calibration is used to quantify error and
-estimate confidence intervals. We’ll perform model calibration on the
-out-of-sample data (aka. the Testing Set) with the
-modeltime_calibrate()
function. Two new columns are
-generated (“.type” and “.calibration_data”), the most important of which
-is the “.calibration_data”. This includes the actual values, fitted
-values, and residuals for the testing set.
-
-
## # Modeltime Table
-## # A tibble: 1 x 5
-## .model_id .model .model_desc .type .calibration_data
-## <int> <list> <chr> <chr> <list>
-## 1 1 <workflow> GLMNET Test <tibble [90 x 4]>
-
-
Forecast (Testing Set)
-
-
With calibrated data, we can visualize the testing predictions
-(forecast).
-
-
-
-
-
-
Accuracy (Testing Set)
-
-
Next, calculate the testing accuracy to compare the models.
-
-
-
-
-
-
-
-Accuracy Table
-
-
-.model_id
- .model_desc
- .type
- mae
- mape
- mase
- smape
- rmse
- rsq
-
-
-
-1
-GLMNET
-Test
-1197.09
-342.47
-1.29
-28.42
-1655.2
-0.48
-
-
-
-
-
-
-
Refit and Forecast Forward
-
-
Refitting is a best-practice before forecasting the
-future.
-
-
-modeltime_refit()
: We re-train on full data
-(bike_transactions_tbl
)
-
-modeltime_forecast()
: For models that only depend on
-the “date” feature, we can use h
(horizon) to forecast
-forward. Setting h = "12 months"
forecasts then next
-12-months of data.
-
-
-
-
-
-
-
Summary
-
-
Timetk is part of the amazing Modeltime Ecosystem for time series
-forecasting. But it can take a long time to learn:
-
-Many algorithms
-Ensembling and Resampling
-Feature Engineering
-Machine Learning
-Deep Learning
-Scalable Modeling: 10,000+ time series
-
-
Your probably thinking how am I ever going to learn time series
-forecasting. Here’s the solution that will save you years of
-struggling.
-
-
-
-
-Become the forecasting expert for your organization
-
-
-
High-Performance
-Time Series Course
-
-
Time Series is Changing
-
-
Time series is changing. Businesses now need 10,000+ time
-series forecasts every day. This is what I call a
-High-Performance Time Series Forecasting System (HPTSF) -
-Accurate, Robust, and Scalable Forecasting.
-
High-Performance Forecasting Systems will save companies by
-improving accuracy and scalability. Imagine what will happen to
-your career if you can provide your organization a “High-Performance
-Time Series Forecasting System” (HPTSF System).
-
-
-
-
I teach how to build a HPTFS System in my High-Performance
-Time Series Forecasting Course . You will learn:
-
-
-Time Series Machine Learning (cutting-edge) with
-Modeltime
- 30+ Models (Prophet, ARIMA, XGBoost, Random
-Forest, & many more)
-
-Deep Learning with GluonTS
-(Competition Winners)
-
-Time Series Preprocessing , Noise Reduction, &
-Anomaly Detection
-
-Feature engineering using lagged variables &
-external regressors
-Hyperparameter Tuning
-Time series cross-validation
-
-Ensembling Multiple Machine Learning &
-Univariate Modeling Techniques (Competition Winner)
-
-Scalable Forecasting - Forecast 1000+ time series
-in parallel
-and more.
-
-
-Become the Time Series Expert for your organization.
-
-
-Take
-the High-Performance Time Series Forecasting Course
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/docs/articles/TK03_Forecasting_Using_Time_Series_Signature_files/core-js-2.5.3/LICENSE b/docs/articles/TK03_Forecasting_Using_Time_Series_Signature_files/core-js-2.5.3/LICENSE
deleted file mode 100644
index d12a3a36..00000000
--- a/docs/articles/TK03_Forecasting_Using_Time_Series_Signature_files/core-js-2.5.3/LICENSE
+++ /dev/null
@@ -1,19 +0,0 @@
-Copyright (c) 2014-2017 Denis Pushkarev
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/docs/articles/TK03_Forecasting_Using_Time_Series_Signature_files/core-js-2.5.3/package.json b/docs/articles/TK03_Forecasting_Using_Time_Series_Signature_files/core-js-2.5.3/package.json
deleted file mode 100644
index da897f39..00000000
--- a/docs/articles/TK03_Forecasting_Using_Time_Series_Signature_files/core-js-2.5.3/package.json
+++ /dev/null
@@ -1,79 +0,0 @@
-{
- "devDependencies": {
- "@babel/cli": "^7.7.7",
- "@babel/core": "^7.7.7",
- "@babel/plugin-proposal-nullish-coalescing-operator": "^7.7.4",
- "@babel/plugin-proposal-optional-catch-binding": "^7.7.4",
- "@babel/plugin-proposal-optional-chaining": "^7.7.5",
- "@babel/plugin-transform-arrow-functions": "^7.7.4",
- "@babel/plugin-transform-block-scoped-functions": "^7.7.4",
- "@babel/plugin-transform-block-scoping": "^7.7.4",
- "@babel/plugin-transform-classes": "^7.7.4",
- "@babel/plugin-transform-computed-properties": "^7.7.4",
- "@babel/plugin-transform-destructuring": "^7.7.4",
- "@babel/plugin-transform-exponentiation-operator": "^7.7.4",
- "@babel/plugin-transform-literals": "^7.7.4",
- "@babel/plugin-transform-member-expression-literals": "^7.7.4",
- "@babel/plugin-transform-parameters": "^7.7.7",
- "@babel/plugin-transform-property-literals": "^7.7.4",
- "@babel/plugin-transform-shorthand-properties": "^7.7.4",
- "@babel/plugin-transform-spread": "^7.7.4",
- "@babel/plugin-transform-template-literals": "^7.7.4",
- "babel-loader": "^8.0.6",
- "babel-plugin-transform-es2015-modules-simple-commonjs": "~0.3.0",
- "babel-plugin-transform-for-of-as-array": "^1.1.1",
- "es-observable": "git+https://github.com/tc39/proposal-observable.git#bf4d87144b6189e793593868e3c022eb51a7d292",
- "eslint": "^6.8.0",
- "eslint-import-resolver-webpack": "^0.12.0",
- "eslint-plugin-import": "^2.19.1",
- "eslint-plugin-node": "^10.0.0",
- "eslint-plugin-optimize-regex": "^1.1.7",
- "eslint-plugin-qunit": "^4.0.0",
- "eslint-plugin-sonarjs": "^0.5.0",
- "eslint-plugin-unicorn": "^15.0.0",
- "grunt": "^1.0.4",
- "grunt-cli": "^1.3.2",
- "grunt-contrib-clean": "^2.0.0",
- "grunt-contrib-copy": "^1.0.0",
- "grunt-contrib-uglify": "^4.0.1",
- "grunt-karma": "^3.0.2",
- "grunt-webpack": "^3.1.3",
- "karma": "^4.4.1",
- "karma-chrome-launcher": "^3.1.0",
- "karma-phantomjs-launcher": "~1.0.4",
- "karma-qunit": "^4.0.0",
- "lerna": "^3.19.0",
- "moon-unit": "^0.2.2",
- "phantomjs-prebuilt": "~2.1.16",
- "promises-aplus-tests": "^2.1.2",
- "puppeteer": "~2.0.0",
- "qunit": "~2.9.3",
- "webpack": "^4.41.4"
- },
- "license": "MIT",
- "repository": {
- "type": "git",
- "url": "https://github.com/zloirock/core-js.git"
- },
- "scripts": {
- "bootstrap": "lerna bootstrap --no-ci",
- "build": "grunt clean copy && npm run bootstrap && npm run build-compat && grunt bundle uglify",
- "build-compat": "npm run build-compat-data && npm run build-compat-entries && npm run build-compat-modules-by-versions",
- "build-compat-data": "node packages/core-js-compat/src/build-data",
- "build-compat-entries": "node packages/core-js-compat/src/build-entries",
- "build-compat-modules-by-versions": "node packages/core-js-compat/src/build-modules-by-versions",
- "lint": "grunt clean copy && npm run bootstrap && npm run build-compat && eslint ./",
- "unit-tests": "grunt clean copy && npm run bootstrap && npm run build-compat && grunt bundle webpack:helpers webpack:tests karma:tests",
- "unit-tests-pure": "grunt clean copy && npm run build-compat && grunt webpack:helpers webpack:pure karma:pure",
- "bundle-promises-tests": "grunt webpack:promises-aplus-tests",
- "promises-tests": "promises-aplus-tests tests/promises-aplus/adapter --timeout 1000",
- "observables-tests": "babel node_modules/es-observable/test/ -d tests/bundles/observables-tests/ && node tests/observables/adapter && node tests/observables/adapter-pure",
- "commonjs-tests": "node tests/commonjs",
- "commonjs-entries-content": "node tests/commonjs-entries-content",
- "targets-parser-tests": "node tests/targets-parser",
- "test": "grunt clean copy && npm run bootstrap && npm run build-compat && eslint ./ && grunt webpack:helpers webpack:tests bundle uglify karma:tests webpack:helpers webpack:pure karma:pure && npm run promises-tests && npm run observables-tests && npm run commonjs-tests && npm run commonjs-entries-content && npm run targets-parser-tests"
- },
- "engines": {
- "node": ">=8.9.0"
- }
-}
diff --git a/docs/articles/TK03_Forecasting_Using_Time_Series_Signature_files/core-js-2.5.3/shim.min.js b/docs/articles/TK03_Forecasting_Using_Time_Series_Signature_files/core-js-2.5.3/shim.min.js
deleted file mode 100644
index dcc9a160..00000000
--- a/docs/articles/TK03_Forecasting_Using_Time_Series_Signature_files/core-js-2.5.3/shim.min.js
+++ /dev/null
@@ -1,10 +0,0 @@
-/**
- * core-js 2.6.11
- * https://github.com/zloirock/core-js
- * License: http://rock.mit-license.org
- * © 2019 Denis Pushkarev
- */
-!function(e,i,Jt){"use strict";!function(r){var e={};function __webpack_require__(t){if(e[t])return e[t].exports;var n=e[t]={i:t,l:!1,exports:{}};return r[t].call(n.exports,n,n.exports,__webpack_require__),n.l=!0,n.exports}__webpack_require__.m=r,__webpack_require__.c=e,__webpack_require__.d=function(t,n,r){__webpack_require__.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},__webpack_require__.n=function(t){var n=t&&t.__esModule?function getDefault(){return t["default"]}:function getModuleExports(){return t};return __webpack_require__.d(n,"a",n),n},__webpack_require__.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=129)}([function(t,n,r){var v=r(2),g=r(26),y=r(11),d=r(12),b=r(18),S="prototype",_=function(t,n,r){var e,i,o,u,c=t&_.F,a=t&_.G,f=t&_.P,s=t&_.B,l=a?v:t&_.S?v[n]||(v[n]={}):(v[n]||{})[S],h=a?g:g[n]||(g[n]={}),p=h[S]||(h[S]={});for(e in a&&(r=n),r)o=((i=!c&&l&&l[e]!==Jt)?l:r)[e],u=s&&i?b(o,v):f&&"function"==typeof o?b(Function.call,o):o,l&&d(l,e,o,t&_.U),h[e]!=o&&y(h,e,u),f&&p[e]!=o&&(p[e]=o)};v.core=g,_.F=1,_.G=2,_.S=4,_.P=8,_.B=16,_.W=32,_.U=64,_.R=128,t.exports=_},function(t,n,r){var e=r(4);t.exports=function(t){if(!e(t))throw TypeError(t+" is not an object!");return t}},function(t,n){var r=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof i&&(i=r)},function(t,n){t.exports=function(t){try{return!!t()}catch(n){return!0}}},function(t,n){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,n,r){var e=r(47)("wks"),i=r(33),o=r(2).Symbol,u="function"==typeof o;(t.exports=function(t){return e[t]||(e[t]=u&&o[t]||(u?o:i)("Symbol."+t))}).store=e},function(t,n,r){var e=r(20),i=Math.min;t.exports=function(t){return 0"+i+""+n+">"};t.exports=function(n,t){var r={};r[n]=t(o),e(e.P+e.F*i(function(){var t=""[n]('"');return t!==t.toLowerCase()||3document.F=Object<\/script>"),t.close(),s=t.F;r--;)delete s[f][u[r]];return s()};t.exports=Object.create||function create(t,n){var r;return null!==t?(a[f]=i(t),r=new a,a[f]=null,r[c]=t):r=s(),n===Jt?r:o(r,n)}},function(t,n,r){var e=r(95),i=r(69).concat("length","prototype");n.f=Object.getOwnPropertyNames||function getOwnPropertyNames(t){return e(t,i)}},function(t,n,r){var e=r(2),i=r(8),o=r(7),u=r(5)("species");t.exports=function(t){var n=e[t];o&&n&&!n[u]&&i.f(n,u,{configurable:!0,get:function(){return this}})}},function(t,n){t.exports=function(t,n,r,e){if(!(t instanceof n)||e!==Jt&&e in t)throw TypeError(r+": incorrect invocation!");return t}},function(t,n,r){var h=r(18),p=r(108),v=r(81),g=r(1),y=r(6),d=r(83),b={},S={};(n=t.exports=function(t,n,r,e,i){var o,u,c,a,f=i?function(){return t}:d(t),s=h(r,e,n?2:1),l=0;if("function"!=typeof f)throw TypeError(t+" is not iterable!");if(v(f)){for(o=y(t.length);l")}),d=function(){var t=/(?:)/,n=t.exec;t.exec=function(){return n.apply(this,arguments)};var r="ab".split(t);return 2===r.length&&"a"===r[0]&&"b"===r[1]}();t.exports=function(r,t,n){var e=p(r),o=!l(function(){var t={};return t[e]=function(){return 7},7!=""[r](t)}),i=o?!l(function(){var t=!1,n=/a/;return n.exec=function(){return t=!0,null},"split"===r&&(n.constructor={},n.constructor[g]=function(){return n}),n[e](""),!t}):Jt;if(!o||!i||"replace"===r&&!y||"split"===r&&!d){var u=/./[e],c=n(h,e,""[r],function maybeCallNative(t,n,r,e,i){return n.exec===v?o&&!i?{done:!0,value:u.call(n,r,e)}:{done:!0,value:t.call(r,n,e)}:{done:!1}}),a=c[1];f(String.prototype,r,c[0]),s(RegExp.prototype,e,2==t?function(t,n){return a.call(t,this,n)}:function(t){return a.call(t,this)})}}},function(t,n,r){var e=r(2).navigator;t.exports=e&&e.userAgent||""},function(t,n,r){var d=r(2),b=r(0),S=r(12),_=r(41),x=r(30),m=r(40),w=r(39),E=r(4),O=r(3),M=r(57),I=r(43),P=r(72);t.exports=function(e,t,n,r,i,o){var u=d[e],c=u,a=i?"set":"add",f=c&&c.prototype,s={},l=function(t){var r=f[t];S(f,t,"delete"==t?function(t){return!(o&&!E(t))&&r.call(this,0===t?0:t)}:"has"==t?function has(t){return!(o&&!E(t))&&r.call(this,0===t?0:t)}:"get"==t?function get(t){return o&&!E(t)?Jt:r.call(this,0===t?0:t)}:"add"==t?function add(t){return r.call(this,0===t?0:t),this}:function set(t,n){return r.call(this,0===t?0:t,n),this})};if("function"==typeof c&&(o||f.forEach&&!O(function(){(new c).entries().next()}))){var h=new c,p=h[a](o?{}:-0,1)!=h,v=O(function(){h.has(1)}),g=M(function(t){new c(t)}),y=!o&&O(function(){for(var t=new c,n=5;n--;)t[a](n,n);return!t.has(-0)});g||(((c=t(function(t,n){w(t,c,e);var r=P(new u,t,c);return n!=Jt&&m(n,i,r[a],r),r})).prototype=f).constructor=c),(v||y)&&(l("delete"),l("has"),i&&l("get")),(y||p)&&l(a),o&&f.clear&&delete f.clear}else c=r.getConstructor(t,e,i,a),_(c.prototype,n),x.NEED=!0;return I(c,e),b(b.G+b.W+b.F*((s[e]=c)!=u),s),o||r.setStrong(c,e,i),c}},function(t,n,r){for(var e,i=r(2),o=r(11),u=r(33),c=u("typed_array"),a=u("view"),f=!(!i.ArrayBuffer||!i.DataView),s=f,l=0,h="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");l<9;)(e=i[h[l++]])?(o(e.prototype,c,!0),o(e.prototype,a,!0)):s=!1;t.exports={ABV:f,CONSTR:s,TYPED:c,VIEW:a}},function(t,n,r){t.exports=r(29)||!r(3)(function(){var t=Math.random();__defineSetter__.call(null,t,function(){}),delete r(2)[t]})},function(t,n,r){var e=r(0);t.exports=function(t){e(e.S,t,{of:function of(){for(var t=arguments.length,n=new Array(t);t--;)n[t]=arguments[t];return new this(n)}})}},function(t,n,r){var e=r(0),u=r(10),c=r(18),a=r(40);t.exports=function(t){e(e.S,t,{from:function from(t){var n,r,e,i,o=arguments[1];return u(this),(n=o!==Jt)&&u(o),t==Jt?new this:(r=[],n?(e=0,i=c(o,arguments[2],2),a(t,!1,function(t){r.push(i(t,e++))})):a(t,!1,r.push,r),new this(r))}})}},function(t,n,r){var e=r(4),i=r(2).document,o=e(i)&&e(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},function(t,n,r){var e=r(2),i=r(26),o=r(29),u=r(94),c=r(8).f;t.exports=function(t){var n=i.Symbol||(i.Symbol=o?{}:e.Symbol||{});"_"==t.charAt(0)||t in n||c(n,t,{value:u.f(t)})}},function(t,n,r){var e=r(47)("keys"),i=r(33);t.exports=function(t){return e[t]||(e[t]=i(t))}},function(t,n){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,n,r){var e=r(2).document;t.exports=e&&e.documentElement},function(t,n,i){var r=i(4),e=i(1),o=function(t,n){if(e(t),!r(n)&&null!==n)throw TypeError(n+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,r,e){try{(e=i(18)(Function.call,i(16).f(Object.prototype,"__proto__").set,2))(t,[]),r=!(t instanceof Array)}catch(n){r=!0}return function setPrototypeOf(t,n){return o(t,n),r?t.__proto__=n:e(t,n),t}}({},!1):Jt),check:o}},function(t,n,r){var o=r(4),u=r(71).set;t.exports=function(t,n,r){var e,i=n.constructor;return i!==r&&"function"==typeof i&&(e=i.prototype)!==r.prototype&&o(e)&&u&&u(t,e),t}},function(t,n){t.exports="\t\n\x0B\f\r \u2028\u2029\ufeff"},function(t,n,r){var i=r(20),o=r(23);t.exports=function repeat(t){var n=String(o(this)),r="",e=i(t);if(e<0||e==Infinity)throw RangeError("Count can't be negative");for(;0>>=1)&&(n+=n))1&e&&(r+=n);return r}},function(t,n){t.exports=Math.sign||function sign(t){return 0==(t=+t)||t!=t?t:t<0?-1:1}},function(t,n){var r=Math.expm1;t.exports=!r||22025.465794806718>1,s=23===n?F(2,-24)-F(2,-77):0,l=0,h=t<0||0===t&&1/t<0?1:0;for((t=P(t))!=t||t===M?(i=t!=t?1:0,e=a):(e=A(k(t)/N),t*(o=F(2,-e))<1&&(e--,o*=2),2<=(t+=1<=e+f?s/o:s*F(2,1-f))*o&&(e++,o/=2),a<=e+f?(i=0,e=a):1<=e+f?(i=(t*o-1)*F(2,n),e+=f):(i=t*F(2,f-1)*F(2,n),e=0));8<=n;u[l++]=255&i,i/=256,n-=8);for(e=e<>1,c=i-7,a=r-1,f=t[a--],s=127&f;for(f>>=7;0>=-c,c+=n;0>8&255]}function packI32(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]}function packF64(t){return packIEEE754(t,52,8)}function packF32(t){return packIEEE754(t,23,4)}function addGetter(t,n,r){g(t[_],n,{get:function(){return this[r]}})}function get(t,n,r,e){var i=p(+r);if(t[L]>24)},setUint8:function setUint8(t,n){B.call(this,t,n<<24>>24)}},!0)}else m=function ArrayBuffer(t){s(this,m,b);var n=p(t);this._b=y.call(new Array(n),0),this[L]=n},w=function DataView(t,n,r){s(this,w,S),s(t,m,S);var e=t[L],i=l(n);if(i<0||e>24},getUint8:function getUint8(t){return get(this,1,t)[0]},getInt16:function getInt16(t){var n=get(this,2,t,arguments[1]);return(n[1]<<8|n[0])<<16>>16},getUint16:function getUint16(t){var n=get(this,2,t,arguments[1]);return n[1]<<8|n[0]},getInt32:function getInt32(t){return unpackI32(get(this,4,t,arguments[1]))},getUint32:function getUint32(t){return unpackI32(get(this,4,t,arguments[1]))>>>0},getFloat32:function getFloat32(t){return unpackIEEE754(get(this,4,t,arguments[1]),23,4)},getFloat64:function getFloat64(t){return unpackIEEE754(get(this,8,t,arguments[1]),52,8)},setInt8:function setInt8(t,n){set(this,1,t,packI8,n)},setUint8:function setUint8(t,n){set(this,1,t,packI8,n)},setInt16:function setInt16(t,n){set(this,2,t,packI16,n,arguments[2])},setUint16:function setUint16(t,n){set(this,2,t,packI16,n,arguments[2])},setInt32:function setInt32(t,n){set(this,4,t,packI32,n,arguments[2])},setUint32:function setUint32(t,n){set(this,4,t,packI32,n,arguments[2])},setFloat32:function setFloat32(t,n){set(this,4,t,packF32,n,arguments[2])},
-setFloat64:function setFloat64(t,n){set(this,8,t,packF64,n,arguments[2])}});d(m,b),d(w,S),c(w[_],u.VIEW,!0),n[b]=m,n[S]=w},function(t,n,r){t.exports=!r(7)&&!r(3)(function(){return 7!=Object.defineProperty(r(66)("div"),"a",{get:function(){return 7}}).a})},function(t,n,r){n.f=r(5)},function(t,n,r){var u=r(14),c=r(15),a=r(52)(!1),f=r(68)("IE_PROTO");t.exports=function(t,n){var r,e=c(t),i=0,o=[];for(r in e)r!=f&&u(e,r)&&o.push(r);for(;i>>0||(u.test(r)?16:10))}:e},function(t,n){t.exports=Math.log1p||function log1p(t){return-1e-8<(t=+t)&&t<1e-8?t-t*t/2:Math.log(1+t)}},function(t,n,r){var o=r(75),e=Math.pow,u=e(2,-52),c=e(2,-23),a=e(2,127)*(2-c),f=e(2,-126);t.exports=Math.fround||function fround(t){var n,r,e=Math.abs(t),i=o(t);return e>>=0)?31-Math.floor(Math.log(t+.5)*Math.LOG2E):32}})},function(t,n,r){var e=r(0),i=Math.exp;e(e.S,"Math",{cosh:function cosh(t){return(i(t=+t)+i(-t))/2}})},function(t,n,r){var e=r(0),i=r(76);e(e.S+e.F*(i!=Math.expm1),"Math",{expm1:i})},function(t,n,r){var e=r(0);e(e.S,"Math",{fround:r(107)})},function(t,n,r){var e=r(0),a=Math.abs;e(e.S,"Math",{hypot:function hypot(t,n){for(var r,e,i=0,o=0,u=arguments.length,c=0;o>>16)*u+o*(r&i>>>16)<<16>>>0)}})},function(t,n,r){var e=r(0);e(e.S,"Math",{log10:function log10(t){return Math.log(t)*Math.LOG10E}})},function(t,n,r){var e=r(0);e(e.S,"Math",{log1p:r(106)})},function(t,n,r){var e=r(0);e(e.S,"Math",{log2:function log2(t){return Math.log(t)/Math.LN2}})},function(t,n,r){var e=r(0);e(e.S,"Math",{sign:r(75)})},function(t,n,r){var e=r(0),i=r(76),o=Math.exp;e(e.S+e.F*r(3)(function(){return-2e-17!=!Math.sinh(-2e-17)}),"Math",{sinh:function sinh(t){return Math.abs(t=+t)<1?(i(t)-i(-t))/2:(o(t-1)-o(-t-1))*(Math.E/2)}})},function(t,n,r){var e=r(0),i=r(76),o=Math.exp;e(e.S,"Math",{tanh:function tanh(t){var n=i(t=+t),r=i(-t);return n==Infinity?1:r==Infinity?-1:(n-r)/(o(t)+o(-t))}})},function(t,n,r){var e=r(0);e(e.S,"Math",{trunc:function trunc(t){return(0>10),n%1024+56320))}return r.join("")}})},function(t,n,r){var e=r(0),u=r(15),c=r(6);e(e.S,"String",{raw:function raw(t){for(var n=u(t.raw),r=c(n.length),e=arguments.length,i=[],o=0;o]*>)/g,v=/\$([$&`']|\d\d?)/g;r(59)("replace",2,function(i,o,x,m){return[function replace(t,n){var r=i(this),e=t==Jt?Jt:t[o];return e!==Jt?e.call(t,r,n):x.call(String(r),t,n)},function(t,n){var r=m(x,t,this,n);if(r.done)return r.value;var e=w(t),i=String(this),o="function"==typeof n;o||(n=String(n));var u=e.global;if(u){var c=e.unicode;e.lastIndex=0}for(var a=[];;){var f=I(e,i);if(
-null===f)break;if(a.push(f),!u)break;""===String(f[0])&&(e.lastIndex=M(i,E(e.lastIndex),c))}for(var s,l="",h=0,p=0;p>>0,f=new RegExp(t.source,(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":"")+"g");(e=l.call(f,r))&&!(c<(i=f[v])&&(u.push(r.slice(c,e.index)),1>>0;if(0===a)return[];if(0===i.length)return null===m(c,i)?[i]:[];for(var f=0,s=0,l=[];s>>0,o=r>>>0;return(n>>>0)+(e>>>0)+((i&o|(i|o)&~(i+o>>>0))>>>31)|0}})},function(t,n,r){var e=r(0);e(e.S,"Math",{isubh:function isubh(t,n,r,e){var i=t>>>0,o=r>>>0;return(n>>>0)-(e>>>0)-((~i&o|~(i^o)&i-o>>>0)>>>31)|0}})},function(t,n,r){var e=r(0);e(e.S,"Math",{imulh:function imulh(t,n){var r=+t,e=+n,i=65535&r,o=65535&e,u=r>>16,c=e>>16,a=(u*o>>>0)+(i*o>>>16);return u*c+(a>>16)+((i*c>>>0)+(65535&a)>>16)}})},function(t,n,r){var e=r(0);e(e.S,"Math",{RAD_PER_DEG:180/Math.PI})},function(t,n,r){var e=r(0),i=Math.PI/180;e(e.S,"Math",{radians:function radians(t){return t*i}})},function(t,n,r){var e=r(0);e(e.S,"Math",{scale:r(128)})},function(t,n,r){var e=r(0);e(e.S,"Math",{umulh:function umulh(t,n){var r=+t,e=+n,i=65535&r,o=65535&e,u=r>>>16,c=e>>>16,a=(u*o>>>0)+(i*o>>>16);return u*c+(a>>>16)+((i*c>>>0)+(65535&a)>>>16)}})},function(t,n,r){var e=r(0);e(e.S,"Math",{signbit:function signbit(t){return(t=+t)!=t?t:0==t?1/t==Infinity:0.container-fluid.crosstalk-bscols{margin-left:auto;margin-right:auto}.crosstalk-input-checkboxgroup .crosstalk-options-group .crosstalk-options-column{display:inline-block;padding-right:12px;vertical-align:top}@media only screen and (max-width: 480px){.crosstalk-input-checkboxgroup .crosstalk-options-group .crosstalk-options-column{display:block;padding-right:inherit}}.crosstalk-input{margin-bottom:15px}.crosstalk-input .control-label{margin-bottom:0;vertical-align:middle}.crosstalk-input input[type="checkbox"]{margin:4px 0 0;margin-top:1px;line-height:normal}.crosstalk-input .checkbox{position:relative;display:block;margin-top:10px;margin-bottom:10px}.crosstalk-input .checkbox>label{padding-left:20px;margin-bottom:0;font-weight:400;cursor:pointer}.crosstalk-input .checkbox input[type="checkbox"],.crosstalk-input .checkbox-inline input[type="checkbox"]{position:absolute;margin-top:2px;margin-left:-20px}.crosstalk-input .checkbox+.checkbox{margin-top:-5px}.crosstalk-input .checkbox-inline{position:relative;display:inline-block;padding-left:20px;margin-bottom:0;font-weight:400;vertical-align:middle;cursor:pointer}.crosstalk-input .checkbox-inline+.checkbox-inline{margin-top:0;margin-left:10px}
diff --git a/docs/articles/TK03_Forecasting_Using_Time_Series_Signature_files/crosstalk-1.2.0/js/crosstalk.js b/docs/articles/TK03_Forecasting_Using_Time_Series_Signature_files/crosstalk-1.2.0/js/crosstalk.js
deleted file mode 100644
index fd9eb53d..00000000
--- a/docs/articles/TK03_Forecasting_Using_Time_Series_Signature_files/crosstalk-1.2.0/js/crosstalk.js
+++ /dev/null
@@ -1,1474 +0,0 @@
-(function(){function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o b) {
- return 1;
- }
-}
-
-/**
- * @private
- */
-
-var FilterSet = function () {
- function FilterSet() {
- _classCallCheck(this, FilterSet);
-
- this.reset();
- }
-
- _createClass(FilterSet, [{
- key: "reset",
- value: function reset() {
- // Key: handle ID, Value: array of selected keys, or null
- this._handles = {};
- // Key: key string, Value: count of handles that include it
- this._keys = {};
- this._value = null;
- this._activeHandles = 0;
- }
- }, {
- key: "update",
- value: function update(handleId, keys) {
- if (keys !== null) {
- keys = keys.slice(0); // clone before sorting
- keys.sort(naturalComparator);
- }
-
- var _diffSortedLists = (0, _util.diffSortedLists)(this._handles[handleId], keys),
- added = _diffSortedLists.added,
- removed = _diffSortedLists.removed;
-
- this._handles[handleId] = keys;
-
- for (var i = 0; i < added.length; i++) {
- this._keys[added[i]] = (this._keys[added[i]] || 0) + 1;
- }
- for (var _i = 0; _i < removed.length; _i++) {
- this._keys[removed[_i]]--;
- }
-
- this._updateValue(keys);
- }
-
- /**
- * @param {string[]} keys Sorted array of strings that indicate
- * a superset of possible keys.
- * @private
- */
-
- }, {
- key: "_updateValue",
- value: function _updateValue() {
- var keys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this._allKeys;
-
- var handleCount = Object.keys(this._handles).length;
- if (handleCount === 0) {
- this._value = null;
- } else {
- this._value = [];
- for (var i = 0; i < keys.length; i++) {
- var count = this._keys[keys[i]];
- if (count === handleCount) {
- this._value.push(keys[i]);
- }
- }
- }
- }
- }, {
- key: "clear",
- value: function clear(handleId) {
- if (typeof this._handles[handleId] === "undefined") {
- return;
- }
-
- var keys = this._handles[handleId];
- if (!keys) {
- keys = [];
- }
-
- for (var i = 0; i < keys.length; i++) {
- this._keys[keys[i]]--;
- }
- delete this._handles[handleId];
-
- this._updateValue();
- }
- }, {
- key: "value",
- get: function get() {
- return this._value;
- }
- }, {
- key: "_allKeys",
- get: function get() {
- var allKeys = Object.keys(this._keys);
- allKeys.sort(naturalComparator);
- return allKeys;
- }
- }]);
-
- return FilterSet;
-}();
-
-exports.default = FilterSet;
-
-},{"./util":11}],4:[function(require,module,exports){
-(function (global){
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
-var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
-
-exports.default = group;
-
-var _var2 = require("./var");
-
-var _var3 = _interopRequireDefault(_var2);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
-// Use a global so that multiple copies of crosstalk.js can be loaded and still
-// have groups behave as singletons across all copies.
-global.__crosstalk_groups = global.__crosstalk_groups || {};
-var groups = global.__crosstalk_groups;
-
-function group(groupName) {
- if (groupName && typeof groupName === "string") {
- if (!groups.hasOwnProperty(groupName)) {
- groups[groupName] = new Group(groupName);
- }
- return groups[groupName];
- } else if ((typeof groupName === "undefined" ? "undefined" : _typeof(groupName)) === "object" && groupName._vars && groupName.var) {
- // Appears to already be a group object
- return groupName;
- } else if (Array.isArray(groupName) && groupName.length == 1 && typeof groupName[0] === "string") {
- return group(groupName[0]);
- } else {
- throw new Error("Invalid groupName argument");
- }
-}
-
-var Group = function () {
- function Group(name) {
- _classCallCheck(this, Group);
-
- this.name = name;
- this._vars = {};
- }
-
- _createClass(Group, [{
- key: "var",
- value: function _var(name) {
- if (!name || typeof name !== "string") {
- throw new Error("Invalid var name");
- }
-
- if (!this._vars.hasOwnProperty(name)) this._vars[name] = new _var3.default(this, name);
- return this._vars[name];
- }
- }, {
- key: "has",
- value: function has(name) {
- if (!name || typeof name !== "string") {
- throw new Error("Invalid var name");
- }
-
- return this._vars.hasOwnProperty(name);
- }
- }]);
-
- return Group;
-}();
-
-}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-
-},{"./var":12}],5:[function(require,module,exports){
-(function (global){
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _group = require("./group");
-
-var _group2 = _interopRequireDefault(_group);
-
-var _selection = require("./selection");
-
-var _filter = require("./filter");
-
-var _input = require("./input");
-
-require("./input_selectize");
-
-require("./input_checkboxgroup");
-
-require("./input_slider");
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-var defaultGroup = (0, _group2.default)("default");
-
-function var_(name) {
- return defaultGroup.var(name);
-}
-
-function has(name) {
- return defaultGroup.has(name);
-}
-
-if (global.Shiny) {
- global.Shiny.addCustomMessageHandler("update-client-value", function (message) {
- if (typeof message.group === "string") {
- (0, _group2.default)(message.group).var(message.name).set(message.value);
- } else {
- var_(message.name).set(message.value);
- }
- });
-}
-
-var crosstalk = {
- group: _group2.default,
- var: var_,
- has: has,
- SelectionHandle: _selection.SelectionHandle,
- FilterHandle: _filter.FilterHandle,
- bind: _input.bind
-};
-
-/**
- * @namespace crosstalk
- */
-exports.default = crosstalk;
-
-global.crosstalk = crosstalk;
-
-}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-
-},{"./filter":2,"./group":4,"./input":6,"./input_checkboxgroup":7,"./input_selectize":8,"./input_slider":9,"./selection":10}],6:[function(require,module,exports){
-(function (global){
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.register = register;
-exports.bind = bind;
-var $ = global.jQuery;
-
-var bindings = {};
-
-function register(reg) {
- bindings[reg.className] = reg;
- if (global.document && global.document.readyState !== "complete") {
- $(function () {
- bind();
- });
- } else if (global.document) {
- setTimeout(bind, 100);
- }
-}
-
-function bind() {
- Object.keys(bindings).forEach(function (className) {
- var binding = bindings[className];
- $("." + binding.className).not(".crosstalk-input-bound").each(function (i, el) {
- bindInstance(binding, el);
- });
- });
-}
-
-// Escape jQuery identifier
-function $escape(val) {
- return val.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g, "\\$1");
-}
-
-function bindEl(el) {
- var $el = $(el);
- Object.keys(bindings).forEach(function (className) {
- if ($el.hasClass(className) && !$el.hasClass("crosstalk-input-bound")) {
- var binding = bindings[className];
- bindInstance(binding, el);
- }
- });
-}
-
-function bindInstance(binding, el) {
- var jsonEl = $(el).find("script[type='application/json'][data-for='" + $escape(el.id) + "']");
- var data = JSON.parse(jsonEl[0].innerText);
-
- var instance = binding.factory(el, data);
- $(el).data("crosstalk-instance", instance);
- $(el).addClass("crosstalk-input-bound");
-}
-
-if (global.Shiny) {
- var inputBinding = new global.Shiny.InputBinding();
- var _$ = global.jQuery;
- _$.extend(inputBinding, {
- find: function find(scope) {
- return _$(scope).find(".crosstalk-input");
- },
- initialize: function initialize(el) {
- if (!_$(el).hasClass("crosstalk-input-bound")) {
- bindEl(el);
- }
- },
- getId: function getId(el) {
- return el.id;
- },
- getValue: function getValue(el) {},
- setValue: function setValue(el, value) {},
- receiveMessage: function receiveMessage(el, data) {},
- subscribe: function subscribe(el, callback) {
- _$(el).data("crosstalk-instance").resume();
- },
- unsubscribe: function unsubscribe(el) {
- _$(el).data("crosstalk-instance").suspend();
- }
- });
- global.Shiny.inputBindings.register(inputBinding, "crosstalk.inputBinding");
-}
-
-}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-
-},{}],7:[function(require,module,exports){
-(function (global){
-"use strict";
-
-var _input = require("./input");
-
-var input = _interopRequireWildcard(_input);
-
-var _filter = require("./filter");
-
-function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
-
-var $ = global.jQuery;
-
-input.register({
- className: "crosstalk-input-checkboxgroup",
-
- factory: function factory(el, data) {
- /*
- * map: {"groupA": ["keyA", "keyB", ...], ...}
- * group: "ct-groupname"
- */
- var ctHandle = new _filter.FilterHandle(data.group);
-
- var lastKnownKeys = void 0;
- var $el = $(el);
- $el.on("change", "input[type='checkbox']", function () {
- var checked = $el.find("input[type='checkbox']:checked");
- if (checked.length === 0) {
- lastKnownKeys = null;
- ctHandle.clear();
- } else {
- var keys = {};
- checked.each(function () {
- data.map[this.value].forEach(function (key) {
- keys[key] = true;
- });
- });
- var keyArray = Object.keys(keys);
- keyArray.sort();
- lastKnownKeys = keyArray;
- ctHandle.set(keyArray);
- }
- });
-
- return {
- suspend: function suspend() {
- ctHandle.clear();
- },
- resume: function resume() {
- if (lastKnownKeys) ctHandle.set(lastKnownKeys);
- }
- };
- }
-});
-
-}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-
-},{"./filter":2,"./input":6}],8:[function(require,module,exports){
-(function (global){
-"use strict";
-
-var _input = require("./input");
-
-var input = _interopRequireWildcard(_input);
-
-var _util = require("./util");
-
-var util = _interopRequireWildcard(_util);
-
-var _filter = require("./filter");
-
-function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
-
-var $ = global.jQuery;
-
-input.register({
- className: "crosstalk-input-select",
-
- factory: function factory(el, data) {
- /*
- * items: {value: [...], label: [...]}
- * map: {"groupA": ["keyA", "keyB", ...], ...}
- * group: "ct-groupname"
- */
-
- var first = [{ value: "", label: "(All)" }];
- var items = util.dataframeToD3(data.items);
- var opts = {
- options: first.concat(items),
- valueField: "value",
- labelField: "label",
- searchField: "label"
- };
-
- var select = $(el).find("select")[0];
-
- var selectize = $(select).selectize(opts)[0].selectize;
-
- var ctHandle = new _filter.FilterHandle(data.group);
-
- var lastKnownKeys = void 0;
- selectize.on("change", function () {
- if (selectize.items.length === 0) {
- lastKnownKeys = null;
- ctHandle.clear();
- } else {
- var keys = {};
- selectize.items.forEach(function (group) {
- data.map[group].forEach(function (key) {
- keys[key] = true;
- });
- });
- var keyArray = Object.keys(keys);
- keyArray.sort();
- lastKnownKeys = keyArray;
- ctHandle.set(keyArray);
- }
- });
-
- return {
- suspend: function suspend() {
- ctHandle.clear();
- },
- resume: function resume() {
- if (lastKnownKeys) ctHandle.set(lastKnownKeys);
- }
- };
- }
-});
-
-}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-
-},{"./filter":2,"./input":6,"./util":11}],9:[function(require,module,exports){
-(function (global){
-"use strict";
-
-var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
-
-var _input = require("./input");
-
-var input = _interopRequireWildcard(_input);
-
-var _filter = require("./filter");
-
-function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
-
-var $ = global.jQuery;
-var strftime = global.strftime;
-
-input.register({
- className: "crosstalk-input-slider",
-
- factory: function factory(el, data) {
- /*
- * map: {"groupA": ["keyA", "keyB", ...], ...}
- * group: "ct-groupname"
- */
- var ctHandle = new _filter.FilterHandle(data.group);
-
- var opts = {};
- var $el = $(el).find("input");
- var dataType = $el.data("data-type");
- var timeFormat = $el.data("time-format");
- var round = $el.data("round");
- var timeFormatter = void 0;
-
- // Set up formatting functions
- if (dataType === "date") {
- timeFormatter = strftime.utc();
- opts.prettify = function (num) {
- return timeFormatter(timeFormat, new Date(num));
- };
- } else if (dataType === "datetime") {
- var timezone = $el.data("timezone");
- if (timezone) timeFormatter = strftime.timezone(timezone);else timeFormatter = strftime;
-
- opts.prettify = function (num) {
- return timeFormatter(timeFormat, new Date(num));
- };
- } else if (dataType === "number") {
- if (typeof round !== "undefined") opts.prettify = function (num) {
- var factor = Math.pow(10, round);
- return Math.round(num * factor) / factor;
- };
- }
-
- $el.ionRangeSlider(opts);
-
- function getValue() {
- var result = $el.data("ionRangeSlider").result;
-
- // Function for converting numeric value from slider to appropriate type.
- var convert = void 0;
- var dataType = $el.data("data-type");
- if (dataType === "date") {
- convert = function convert(val) {
- return formatDateUTC(new Date(+val));
- };
- } else if (dataType === "datetime") {
- convert = function convert(val) {
- // Convert ms to s
- return +val / 1000;
- };
- } else {
- convert = function convert(val) {
- return +val;
- };
- }
-
- if ($el.data("ionRangeSlider").options.type === "double") {
- return [convert(result.from), convert(result.to)];
- } else {
- return convert(result.from);
- }
- }
-
- var lastKnownKeys = null;
-
- $el.on("change.crosstalkSliderInput", function (event) {
- if (!$el.data("updating") && !$el.data("animating")) {
- var _getValue = getValue(),
- _getValue2 = _slicedToArray(_getValue, 2),
- from = _getValue2[0],
- to = _getValue2[1];
-
- var keys = [];
- for (var i = 0; i < data.values.length; i++) {
- var val = data.values[i];
- if (val >= from && val <= to) {
- keys.push(data.keys[i]);
- }
- }
- keys.sort();
- ctHandle.set(keys);
- lastKnownKeys = keys;
- }
- });
-
- // let $el = $(el);
- // $el.on("change", "input[type="checkbox"]", function() {
- // let checked = $el.find("input[type="checkbox"]:checked");
- // if (checked.length === 0) {
- // ctHandle.clear();
- // } else {
- // let keys = {};
- // checked.each(function() {
- // data.map[this.value].forEach(function(key) {
- // keys[key] = true;
- // });
- // });
- // let keyArray = Object.keys(keys);
- // keyArray.sort();
- // ctHandle.set(keyArray);
- // }
- // });
-
- return {
- suspend: function suspend() {
- ctHandle.clear();
- },
- resume: function resume() {
- if (lastKnownKeys) ctHandle.set(lastKnownKeys);
- }
- };
- }
-});
-
-// Convert a number to a string with leading zeros
-function padZeros(n, digits) {
- var str = n.toString();
- while (str.length < digits) {
- str = "0" + str;
- }return str;
-}
-
-// Given a Date object, return a string in yyyy-mm-dd format, using the
-// UTC date. This may be a day off from the date in the local time zone.
-function formatDateUTC(date) {
- if (date instanceof Date) {
- return date.getUTCFullYear() + "-" + padZeros(date.getUTCMonth() + 1, 2) + "-" + padZeros(date.getUTCDate(), 2);
- } else {
- return null;
- }
-}
-
-}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-
-},{"./filter":2,"./input":6}],10:[function(require,module,exports){
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.SelectionHandle = undefined;
-
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
-var _events = require("./events");
-
-var _events2 = _interopRequireDefault(_events);
-
-var _group = require("./group");
-
-var _group2 = _interopRequireDefault(_group);
-
-var _util = require("./util");
-
-var util = _interopRequireWildcard(_util);
-
-function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
-/**
- * Use this class to read and write (and listen for changes to) the selection
- * for a Crosstalk group. This is intended to be used for linked brushing.
- *
- * If two (or more) `SelectionHandle` instances in the same webpage share the
- * same group name, they will share the same state. Setting the selection using
- * one `SelectionHandle` instance will result in the `value` property instantly
- * changing across the others, and `"change"` event listeners on all instances
- * (including the one that initiated the sending) will fire.
- *
- * @param {string} [group] - The name of the Crosstalk group, or if none,
- * null or undefined (or any other falsy value). This can be changed later
- * via the [SelectionHandle#setGroup](#setGroup) method.
- * @param {Object} [extraInfo] - An object whose properties will be copied to
- * the event object whenever an event is emitted.
- */
-var SelectionHandle = exports.SelectionHandle = function () {
- function SelectionHandle() {
- var group = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
- var extraInfo = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
-
- _classCallCheck(this, SelectionHandle);
-
- this._eventRelay = new _events2.default();
- this._emitter = new util.SubscriptionTracker(this._eventRelay);
-
- // Name of the group we're currently tracking, if any. Can change over time.
- this._group = null;
- // The Var we're currently tracking, if any. Can change over time.
- this._var = null;
- // The event handler subscription we currently have on var.on("change").
- this._varOnChangeSub = null;
-
- this._extraInfo = util.extend({ sender: this }, extraInfo);
-
- this.setGroup(group);
- }
-
- /**
- * Changes the Crosstalk group membership of this SelectionHandle. The group
- * being switched away from (if any) will not have its selection value
- * modified as a result of calling `setGroup`, even if this handle was the
- * most recent handle to set the selection of the group.
- *
- * The group being switched to (if any) will also not have its selection value
- * modified as a result of calling `setGroup`. If you want to set the
- * selection value of the new group, call `set` explicitly.
- *
- * @param {string} group - The name of the Crosstalk group, or null (or
- * undefined) to clear the group.
- */
-
-
- _createClass(SelectionHandle, [{
- key: "setGroup",
- value: function setGroup(group) {
- var _this = this;
-
- // If group is unchanged, do nothing
- if (this._group === group) return;
- // Treat null, undefined, and other falsy values the same
- if (!this._group && !group) return;
-
- if (this._var) {
- this._var.off("change", this._varOnChangeSub);
- this._var = null;
- this._varOnChangeSub = null;
- }
-
- this._group = group;
-
- if (group) {
- this._var = (0, _group2.default)(group).var("selection");
- var sub = this._var.on("change", function (e) {
- _this._eventRelay.trigger("change", e, _this);
- });
- this._varOnChangeSub = sub;
- }
- }
-
- /**
- * Retrieves the current selection for the group represented by this
- * `SelectionHandle`.
- *
- * - If no selection is active, then this value will be falsy.
- * - If a selection is active, but no data points are selected, then this
- * value will be an empty array.
- * - If a selection is active, and data points are selected, then the keys
- * of the selected data points will be present in the array.
- */
-
- }, {
- key: "_mergeExtraInfo",
-
-
- /**
- * Combines the given `extraInfo` (if any) with the handle's default
- * `_extraInfo` (if any).
- * @private
- */
- value: function _mergeExtraInfo(extraInfo) {
- // Important incidental effect: shallow clone is returned
- return util.extend({}, this._extraInfo ? this._extraInfo : null, extraInfo ? extraInfo : null);
- }
-
- /**
- * Overwrites the current selection for the group, and raises the `"change"`
- * event among all of the group's '`SelectionHandle` instances (including
- * this one).
- *
- * @fires SelectionHandle#change
- * @param {string[]} selectedKeys - Falsy, empty array, or array of keys (see
- * {@link SelectionHandle#value}).
- * @param {Object} [extraInfo] - Extra properties to be included on the event
- * object that's passed to listeners (in addition to any options that were
- * passed into the `SelectionHandle` constructor).
- */
-
- }, {
- key: "set",
- value: function set(selectedKeys, extraInfo) {
- if (this._var) this._var.set(selectedKeys, this._mergeExtraInfo(extraInfo));
- }
-
- /**
- * Overwrites the current selection for the group, and raises the `"change"`
- * event among all of the group's '`SelectionHandle` instances (including
- * this one).
- *
- * @fires SelectionHandle#change
- * @param {Object} [extraInfo] - Extra properties to be included on the event
- * object that's passed to listeners (in addition to any that were passed
- * into the `SelectionHandle` constructor).
- */
-
- }, {
- key: "clear",
- value: function clear(extraInfo) {
- if (this._var) this.set(void 0, this._mergeExtraInfo(extraInfo));
- }
-
- /**
- * Subscribes to events on this `SelectionHandle`.
- *
- * @param {string} eventType - Indicates the type of events to listen to.
- * Currently, only `"change"` is supported.
- * @param {SelectionHandle~listener} listener - The callback function that
- * will be invoked when the event occurs.
- * @return {string} - A token to pass to {@link SelectionHandle#off} to cancel
- * this subscription.
- */
-
- }, {
- key: "on",
- value: function on(eventType, listener) {
- return this._emitter.on(eventType, listener);
- }
-
- /**
- * Cancels event subscriptions created by {@link SelectionHandle#on}.
- *
- * @param {string} eventType - The type of event to unsubscribe.
- * @param {string|SelectionHandle~listener} listener - Either the callback
- * function previously passed into {@link SelectionHandle#on}, or the
- * string that was returned from {@link SelectionHandle#on}.
- */
-
- }, {
- key: "off",
- value: function off(eventType, listener) {
- return this._emitter.off(eventType, listener);
- }
-
- /**
- * Shuts down the `SelectionHandle` object.
- *
- * Removes all event listeners that were added through this handle.
- */
-
- }, {
- key: "close",
- value: function close() {
- this._emitter.removeAllListeners();
- this.setGroup(null);
- }
- }, {
- key: "value",
- get: function get() {
- return this._var ? this._var.get() : null;
- }
- }]);
-
- return SelectionHandle;
-}();
-
-/**
- * @callback SelectionHandle~listener
- * @param {Object} event - An object containing details of the event. For
- * `"change"` events, this includes the properties `value` (the new
- * value of the selection, or `undefined` if no selection is active),
- * `oldValue` (the previous value of the selection), and `sender` (the
- * `SelectionHandle` instance that made the change).
- */
-
-/**
- * @event SelectionHandle#change
- * @type {object}
- * @property {object} value - The new value of the selection, or `undefined`
- * if no selection is active.
- * @property {object} oldValue - The previous value of the selection.
- * @property {SelectionHandle} sender - The `SelectionHandle` instance that
- * changed the value.
- */
-
-},{"./events":1,"./group":4,"./util":11}],11:[function(require,module,exports){
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
-var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
-
-exports.extend = extend;
-exports.checkSorted = checkSorted;
-exports.diffSortedLists = diffSortedLists;
-exports.dataframeToD3 = dataframeToD3;
-
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
-function extend(target) {
- for (var _len = arguments.length, sources = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- sources[_key - 1] = arguments[_key];
- }
-
- for (var i = 0; i < sources.length; i++) {
- var src = sources[i];
- if (typeof src === "undefined" || src === null) continue;
-
- for (var key in src) {
- if (src.hasOwnProperty(key)) {
- target[key] = src[key];
- }
- }
- }
- return target;
-}
-
-function checkSorted(list) {
- for (var i = 1; i < list.length; i++) {
- if (list[i] <= list[i - 1]) {
- throw new Error("List is not sorted or contains duplicate");
- }
- }
-}
-
-function diffSortedLists(a, b) {
- var i_a = 0;
- var i_b = 0;
-
- if (!a) a = [];
- if (!b) b = [];
-
- var a_only = [];
- var b_only = [];
-
- checkSorted(a);
- checkSorted(b);
-
- while (i_a < a.length && i_b < b.length) {
- if (a[i_a] === b[i_b]) {
- i_a++;
- i_b++;
- } else if (a[i_a] < b[i_b]) {
- a_only.push(a[i_a++]);
- } else {
- b_only.push(b[i_b++]);
- }
- }
-
- if (i_a < a.length) a_only = a_only.concat(a.slice(i_a));
- if (i_b < b.length) b_only = b_only.concat(b.slice(i_b));
- return {
- removed: a_only,
- added: b_only
- };
-}
-
-// Convert from wide: { colA: [1,2,3], colB: [4,5,6], ... }
-// to long: [ {colA: 1, colB: 4}, {colA: 2, colB: 5}, ... ]
-function dataframeToD3(df) {
- var names = [];
- var length = void 0;
- for (var name in df) {
- if (df.hasOwnProperty(name)) names.push(name);
- if (_typeof(df[name]) !== "object" || typeof df[name].length === "undefined") {
- throw new Error("All fields must be arrays");
- } else if (typeof length !== "undefined" && length !== df[name].length) {
- throw new Error("All fields must be arrays of the same length");
- }
- length = df[name].length;
- }
- var results = [];
- var item = void 0;
- for (var row = 0; row < length; row++) {
- item = {};
- for (var col = 0; col < names.length; col++) {
- item[names[col]] = df[names[col]][row];
- }
- results.push(item);
- }
- return results;
-}
-
-/**
- * Keeps track of all event listener additions/removals and lets all active
- * listeners be removed with a single operation.
- *
- * @private
- */
-
-var SubscriptionTracker = exports.SubscriptionTracker = function () {
- function SubscriptionTracker(emitter) {
- _classCallCheck(this, SubscriptionTracker);
-
- this._emitter = emitter;
- this._subs = {};
- }
-
- _createClass(SubscriptionTracker, [{
- key: "on",
- value: function on(eventType, listener) {
- var sub = this._emitter.on(eventType, listener);
- this._subs[sub] = eventType;
- return sub;
- }
- }, {
- key: "off",
- value: function off(eventType, listener) {
- var sub = this._emitter.off(eventType, listener);
- if (sub) {
- delete this._subs[sub];
- }
- return sub;
- }
- }, {
- key: "removeAllListeners",
- value: function removeAllListeners() {
- var _this = this;
-
- var current_subs = this._subs;
- this._subs = {};
- Object.keys(current_subs).forEach(function (sub) {
- _this._emitter.off(current_subs[sub], sub);
- });
- }
- }]);
-
- return SubscriptionTracker;
-}();
-
-},{}],12:[function(require,module,exports){
-(function (global){
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
-
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
-var _events = require("./events");
-
-var _events2 = _interopRequireDefault(_events);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
-var Var = function () {
- function Var(group, name, /*optional*/value) {
- _classCallCheck(this, Var);
-
- this._group = group;
- this._name = name;
- this._value = value;
- this._events = new _events2.default();
- }
-
- _createClass(Var, [{
- key: "get",
- value: function get() {
- return this._value;
- }
- }, {
- key: "set",
- value: function set(value, /*optional*/event) {
- if (this._value === value) {
- // Do nothing; the value hasn't changed
- return;
- }
- var oldValue = this._value;
- this._value = value;
- // Alert JavaScript listeners that the value has changed
- var evt = {};
- if (event && (typeof event === "undefined" ? "undefined" : _typeof(event)) === "object") {
- for (var k in event) {
- if (event.hasOwnProperty(k)) evt[k] = event[k];
- }
- }
- evt.oldValue = oldValue;
- evt.value = value;
- this._events.trigger("change", evt, this);
-
- // TODO: Make this extensible, to let arbitrary back-ends know that
- // something has changed
- if (global.Shiny && global.Shiny.onInputChange) {
- global.Shiny.onInputChange(".clientValue-" + (this._group.name !== null ? this._group.name + "-" : "") + this._name, typeof value === "undefined" ? null : value);
- }
- }
- }, {
- key: "on",
- value: function on(eventType, listener) {
- return this._events.on(eventType, listener);
- }
- }, {
- key: "off",
- value: function off(eventType, listener) {
- return this._events.off(eventType, listener);
- }
- }]);
-
- return Var;
-}();
-
-exports.default = Var;
-
-}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-
-},{"./events":1}]},{},[5])
-//# sourceMappingURL=crosstalk.js.map
diff --git a/docs/articles/TK03_Forecasting_Using_Time_Series_Signature_files/crosstalk-1.2.0/js/crosstalk.js.map b/docs/articles/TK03_Forecasting_Using_Time_Series_Signature_files/crosstalk-1.2.0/js/crosstalk.js.map
deleted file mode 100644
index cff94f08..00000000
--- a/docs/articles/TK03_Forecasting_Using_Time_Series_Signature_files/crosstalk-1.2.0/js/crosstalk.js.map
+++ /dev/null
@@ -1,37 +0,0 @@
-{
- "version": 3,
- "sources": [
- "node_modules/browser-pack/_prelude.js",
- "javascript/src/events.js",
- "javascript/src/filter.js",
- "javascript/src/filterset.js",
- "javascript/src/group.js",
- "javascript/src/index.js",
- "javascript/src/input.js",
- "javascript/src/input_checkboxgroup.js",
- "javascript/src/input_selectize.js",
- "javascript/src/input_slider.js",
- "javascript/src/selection.js",
- "javascript/src/util.js",
- "javascript/src/var.js"
- ],
- "names": [],
- "mappings": "AAAA;;;;;;;;;;;ICAqB,M;AACnB,oBAAc;AAAA;;AACZ,SAAK,MAAL,GAAc,EAAd;AACA,SAAK,IAAL,GAAY,CAAZ;AACD;;;;uBAEE,S,EAAW,Q,EAAU;AACtB,UAAI,OAAO,KAAK,MAAL,CAAY,SAAZ,CAAX;AACA,UAAI,CAAC,IAAL,EAAW;AACT,eAAO,KAAK,MAAL,CAAY,SAAZ,IAAyB,EAAhC;AACD;AACD,UAAI,MAAM,QAAS,KAAK,IAAL,EAAnB;AACA,WAAK,GAAL,IAAY,QAAZ;AACA,aAAO,GAAP;AACD;;AAED;;;;wBACI,S,EAAW,Q,EAAU;AACvB,UAAI,OAAO,KAAK,MAAL,CAAY,SAAZ,CAAX;AACA,UAAI,OAAO,QAAP,KAAqB,UAAzB,EAAqC;AACnC,aAAK,IAAI,GAAT,IAAgB,IAAhB,EAAsB;AACpB,cAAI,KAAK,cAAL,CAAoB,GAApB,CAAJ,EAA8B;AAC5B,gBAAI,KAAK,GAAL,MAAc,QAAlB,EAA4B;AAC1B,qBAAO,KAAK,GAAL,CAAP;AACA,qBAAO,GAAP;AACD;AACF;AACF;AACD,eAAO,KAAP;AACD,OAVD,MAUO,IAAI,OAAO,QAAP,KAAqB,QAAzB,EAAmC;AACxC,YAAI,QAAQ,KAAK,QAAL,CAAZ,EAA4B;AAC1B,iBAAO,KAAK,QAAL,CAAP;AACA,iBAAO,QAAP;AACD;AACD,eAAO,KAAP;AACD,OANM,MAMA;AACL,cAAM,IAAI,KAAJ,CAAU,8BAAV,CAAN;AACD;AACF;;;4BAEO,S,EAAW,G,EAAK,O,EAAS;AAC/B,UAAI,OAAO,KAAK,MAAL,CAAY,SAAZ,CAAX;AACA,WAAK,IAAI,G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Root": "",
- "sourcesContent": [
- "(function(){function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o {\n this._eventRelay.trigger(\"change\", e, this);\n });\n this._varOnChangeSub = sub;\n }\n }\n\n /**\n * Combine the given `extraInfo` (if any) with the handle's default\n * `_extraInfo` (if any).\n * @private\n */\n _mergeExtraInfo(extraInfo) {\n return util.extend({},\n this._extraInfo ? this._extraInfo : null,\n extraInfo ? extraInfo : null);\n }\n\n /**\n * Close the handle. This clears this handle's contribution to the filter set,\n * and unsubscribes all event listeners.\n */\n close() {\n this._emitter.removeAllListeners();\n this.clear();\n this.setGroup(null);\n }\n\n /**\n * Clear this handle's contribution to the filter set.\n *\n * @param {Object} [extraInfo] - Extra properties to be included on the event\n * object that's passed to listeners (in addition to any options that were\n * passed into the `FilterHandle` constructor).\n * \n * @fires FilterHandle#change\n */\n clear(extraInfo) {\n if (!this._filterSet)\n return;\n this._filterSet.clear(this._id);\n this._onChange(extraInfo);\n }\n\n /**\n * Set this handle's contribution to the filter set. This array should consist\n * of the keys of the rows that _should_ be displayed; any keys that are not\n * present in the array will be considered _filtered out_. Note that multiple\n * `FilterHandle` instances in the group may each contribute an array of keys,\n * and only those keys that appear in _all_ of the arrays make it through the\n * filter.\n *\n * @param {string[]} keys - Empty array, or array of keys. To clear the\n * filter, don't pass an empty array; instead, use the\n * {@link FilterHandle#clear} method.\n * @param {Object} [extraInfo] - Extra properties to be included on the event\n * object that's passed to listeners (in addition to any options that were\n * passed into the `FilterHandle` constructor).\n * \n * @fires FilterHandle#change\n */\n set(keys, extraInfo) {\n if (!this._filterSet)\n return;\n this._filterSet.update(this._id, keys);\n this._onChange(extraInfo);\n }\n\n /**\n * @return {string[]|null} - Either: 1) an array of keys that made it through\n * all of the `FilterHandle` instances, or, 2) `null`, which means no filter\n * is being applied (all data should be displayed).\n */\n get filteredKeys() {\n return this._filterSet ? this._filterSet.value : null;\n }\n\n /**\n * Subscribe to events on this `FilterHandle`.\n *\n * @param {string} eventType - Indicates the type of events to listen to.\n * Currently, only `\"change\"` is supported.\n * @param {FilterHandle~listener} listener - The callback function that\n * will be invoked when the event occurs.\n * @return {string} - A token to pass to {@link FilterHandle#off} to cancel\n * this subscription.\n */\n on(eventType, listener) {\n return this._emitter.on(eventType, listener);\n }\n\n /**\n * Cancel event subscriptions created by {@link FilterHandle#on}.\n *\n * @param {string} eventType - The type of event to unsubscribe.\n * @param {string|FilterHandle~listener} listener - Either the callback\n * function previously passed into {@link FilterHandle#on}, or the\n * string that was returned from {@link FilterHandle#on}.\n */\n off(eventType, listener) {\n return this._emitter.off(eventType, listener);\n }\n\n _onChange(extraInfo) {\n if (!this._filterSet)\n return;\n this._filterVar.set(this._filterSet.value, this._mergeExtraInfo(extraInfo));\n }\n\n /**\n * @callback FilterHandle~listener\n * @param {Object} event - An object containing details of the event. For\n * `\"change\"` events, this includes the properties `value` (the new\n * value of the filter set, or `null` if no filter set is active),\n * `oldValue` (the previous value of the filter set), and `sender` (the\n * `FilterHandle` instance that made the change).\n */\n\n}\n\n/**\n * @event FilterHandle#change\n * @type {object}\n * @property {object} value - The new value of the filter set, or `null`\n * if no filter set is active.\n * @property {object} oldValue - The previous value of the filter set.\n * @property {FilterHandle} sender - The `FilterHandle` instance that\n * changed the value.\n */\n",
- "import { diffSortedLists } from \"./util\";\n\nfunction naturalComparator(a, b) {\n if (a === b) {\n return 0;\n } else if (a < b) {\n return -1;\n } else if (a > b) {\n return 1;\n }\n}\n\n/**\n * @private\n */\nexport default class FilterSet {\n constructor() {\n this.reset();\n }\n\n reset() {\n // Key: handle ID, Value: array of selected keys, or null\n this._handles = {};\n // Key: key string, Value: count of handles that include it\n this._keys = {};\n this._value = null;\n this._activeHandles = 0;\n }\n\n get value() {\n return this._value;\n }\n\n update(handleId, keys) {\n if (keys !== null) {\n keys = keys.slice(0); // clone before sorting\n keys.sort(naturalComparator);\n }\n\n let {added, removed} = diffSortedLists(this._handles[handleId], keys);\n this._handles[handleId] = keys;\n\n for (let i = 0; i < added.length; i++) {\n this._keys[added[i]] = (this._keys[added[i]] || 0) + 1;\n }\n for (let i = 0; i < removed.length; i++) {\n this._keys[removed[i]]--;\n }\n\n this._updateValue(keys);\n }\n\n /**\n * @param {string[]} keys Sorted array of strings that indicate\n * a superset of possible keys.\n * @private\n */\n _updateValue(keys = this._allKeys) {\n let handleCount = Object.keys(this._handles).length;\n if (handleCount === 0) {\n this._value = null;\n } else {\n this._value = [];\n for (let i = 0; i < keys.length; i++) {\n let count = this._keys[keys[i]];\n if (count === handleCount) {\n this._value.push(keys[i]);\n }\n }\n }\n }\n\n clear(handleId) {\n if (typeof(this._handles[handleId]) === \"undefined\") {\n return;\n }\n\n let keys = this._handles[handleId];\n if (!keys) {\n keys = [];\n }\n\n for (let i = 0; i < keys.length; i++) {\n this._keys[keys[i]]--;\n }\n delete this._handles[handleId];\n\n this._updateValue();\n }\n\n get _allKeys() {\n let allKeys = Object.keys(this._keys);\n allKeys.sort(naturalComparator);\n return allKeys;\n }\n}\n",
- "import Var from \"./var\";\n\n// Use a global so that multiple copies of crosstalk.js can be loaded and still\n// have groups behave as singletons across all copies.\nglobal.__crosstalk_groups = global.__crosstalk_groups || {};\nlet groups = global.__crosstalk_groups;\n\nexport default function group(groupName) {\n if (groupName && typeof(groupName) === \"string\") {\n if (!groups.hasOwnProperty(groupName)) {\n groups[groupName] = new Group(groupName);\n }\n return groups[groupName];\n } else if (typeof(groupName) === \"object\" && groupName._vars && groupName.var) {\n // Appears to already be a group object\n return groupName;\n } else if (Array.isArray(groupName) &&\n groupName.length == 1 &&\n typeof(groupName[0]) === \"string\") {\n return group(groupName[0]);\n } else {\n throw new Error(\"Invalid groupName argument\");\n }\n}\n\nclass Group {\n constructor(name) {\n this.name = name;\n this._vars = {};\n }\n\n var(name) {\n if (!name || typeof(name) !== \"string\") {\n throw new Error(\"Invalid var name\");\n }\n\n if (!this._vars.hasOwnProperty(name))\n this._vars[name] = new Var(this, name);\n return this._vars[name];\n }\n\n has(name) {\n if (!name || typeof(name) !== \"string\") {\n throw new Error(\"Invalid var name\");\n }\n\n return this._vars.hasOwnProperty(name);\n }\n}\n",
- "import group from \"./group\";\nimport { SelectionHandle } from \"./selection\";\nimport { FilterHandle } from \"./filter\";\nimport { bind } from \"./input\";\nimport \"./input_selectize\";\nimport \"./input_checkboxgroup\";\nimport \"./input_slider\";\n\nconst defaultGroup = group(\"default\");\n\nfunction var_(name) {\n return defaultGroup.var(name);\n}\n\nfunction has(name) {\n return defaultGroup.has(name);\n}\n\nif (global.Shiny) {\n global.Shiny.addCustomMessageHandler(\"update-client-value\", function(message) {\n if (typeof(message.group) === \"string\") {\n group(message.group).var(message.name).set(message.value);\n } else {\n var_(message.name).set(message.value);\n }\n });\n}\n\nconst crosstalk = {\n group: group,\n var: var_,\n has: has,\n SelectionHandle: SelectionHandle,\n FilterHandle: FilterHandle,\n bind: bind\n};\n\n/**\n * @namespace crosstalk\n */\nexport default crosstalk;\nglobal.crosstalk = crosstalk;\n",
- "let $ = global.jQuery;\n\nlet bindings = {};\n\nexport function register(reg) {\n bindings[reg.className] = reg;\n if (global.document && global.document.readyState !== \"complete\") {\n $(() => {\n bind();\n });\n } else if (global.document) {\n setTimeout(bind, 100);\n }\n}\n\nexport function bind() {\n Object.keys(bindings).forEach(function(className) {\n let binding = bindings[className];\n $(\".\" + binding.className).not(\".crosstalk-input-bound\").each(function(i, el) {\n bindInstance(binding, el);\n });\n });\n}\n\n// Escape jQuery identifier\nfunction $escape(val) {\n return val.replace(/([!\"#$%&'()*+,./:;<=>?@[\\\\\\]^`{|}~])/g, \"\\\\$1\");\n}\n\nfunction bindEl(el) {\n let $el = $(el);\n Object.keys(bindings).forEach(function(className) {\n if ($el.hasClass(className) && !$el.hasClass(\"crosstalk-input-bound\")) {\n let binding = bindings[className];\n bindInstance(binding, el);\n }\n });\n}\n\nfunction bindInstance(binding, el) {\n let jsonEl = $(el).find(\"script[type='application/json'][data-for='\" + $escape(el.id) + \"']\");\n let data = JSON.parse(jsonEl[0].innerText);\n\n let instance = binding.factory(el, data);\n $(el).data(\"crosstalk-instance\", instance);\n $(el).addClass(\"crosstalk-input-bound\");\n}\n\nif (global.Shiny) {\n let inputBinding = new global.Shiny.InputBinding();\n let $ = global.jQuery;\n $.extend(inputBinding, {\n find: function(scope) {\n return $(scope).find(\".crosstalk-input\");\n },\n initialize: function(el) {\n if (!$(el).hasClass(\"crosstalk-input-bound\")) {\n bindEl(el);\n }\n },\n getId: function(el) {\n return el.id;\n },\n getValue: function(el) {\n\n },\n setValue: function(el, value) {\n\n },\n receiveMessage: function(el, data) {\n\n },\n subscribe: function(el, callback) {\n $(el).data(\"crosstalk-instance\").resume();\n },\n unsubscribe: function(el) {\n $(el).data(\"crosstalk-instance\").suspend();\n }\n });\n global.Shiny.inputBindings.register(inputBinding, \"crosstalk.inputBinding\");\n}\n",
- "import * as input from \"./input\";\nimport { FilterHandle } from \"./filter\";\n\nlet $ = global.jQuery;\n\ninput.register({\n className: \"crosstalk-input-checkboxgroup\",\n\n factory: function(el, data) {\n /*\n * map: {\"groupA\": [\"keyA\", \"keyB\", ...], ...}\n * group: \"ct-groupname\"\n */\n let ctHandle = new FilterHandle(data.group);\n\n let lastKnownKeys;\n let $el = $(el);\n $el.on(\"change\", \"input[type='checkbox']\", function() {\n let checked = $el.find(\"input[type='checkbox']:checked\");\n if (checked.length === 0) {\n lastKnownKeys = null;\n ctHandle.clear();\n } else {\n let keys = {};\n checked.each(function() {\n data.map[this.value].forEach(function(key) {\n keys[key] = true;\n });\n });\n let keyArray = Object.keys(keys);\n keyArray.sort();\n lastKnownKeys = keyArray;\n ctHandle.set(keyArray);\n }\n });\n\n return {\n suspend: function() {\n ctHandle.clear();\n },\n resume: function() {\n if (lastKnownKeys)\n ctHandle.set(lastKnownKeys);\n }\n };\n }\n});\n",
- "import * as input from \"./input\";\nimport * as util from \"./util\";\nimport { FilterHandle } from \"./filter\";\n\nlet $ = global.jQuery;\n\ninput.register({\n className: \"crosstalk-input-select\",\n\n factory: function(el, data) {\n /*\n * items: {value: [...], label: [...]}\n * map: {\"groupA\": [\"keyA\", \"keyB\", ...], ...}\n * group: \"ct-groupname\"\n */\n\n let first = [{value: \"\", label: \"(All)\"}];\n let items = util.dataframeToD3(data.items);\n let opts = {\n options: first.concat(items),\n valueField: \"value\",\n labelField: \"label\",\n searchField: \"label\"\n };\n\n let select = $(el).find(\"select\")[0];\n\n let selectize = $(select).selectize(opts)[0].selectize;\n\n let ctHandle = new FilterHandle(data.group);\n\n let lastKnownKeys;\n selectize.on(\"change\", function() {\n if (selectize.items.length === 0) {\n lastKnownKeys = null;\n ctHandle.clear();\n } else {\n let keys = {};\n selectize.items.forEach(function(group) {\n data.map[group].forEach(function(key) {\n keys[key] = true;\n });\n });\n let keyArray = Object.keys(keys);\n keyArray.sort();\n lastKnownKeys = keyArray;\n ctHandle.set(keyArray);\n }\n });\n\n return {\n suspend: function() {\n ctHandle.clear();\n },\n resume: function() {\n if (lastKnownKeys)\n ctHandle.set(lastKnownKeys);\n }\n };\n }\n});\n",
- "import * as input from \"./input\";\nimport { FilterHandle } from \"./filter\";\n\nlet $ = global.jQuery;\nlet strftime = global.strftime;\n\ninput.register({\n className: \"crosstalk-input-slider\",\n\n factory: function(el, data) {\n /*\n * map: {\"groupA\": [\"keyA\", \"keyB\", ...], ...}\n * group: \"ct-groupname\"\n */\n let ctHandle = new FilterHandle(data.group);\n\n let opts = {};\n let $el = $(el).find(\"input\");\n let dataType = $el.data(\"data-type\");\n let timeFormat = $el.data(\"time-format\");\n let round = $el.data(\"round\");\n let timeFormatter;\n\n // Set up formatting functions\n if (dataType === \"date\") {\n timeFormatter = strftime.utc();\n opts.prettify = function(num) {\n return timeFormatter(timeFormat, new Date(num));\n };\n\n } else if (dataType === \"datetime\") {\n let timezone = $el.data(\"timezone\");\n if (timezone)\n timeFormatter = strftime.timezone(timezone);\n else\n timeFormatter = strftime;\n\n opts.prettify = function(num) {\n return timeFormatter(timeFormat, new Date(num));\n };\n } else if (dataType === \"number\") {\n if (typeof round !== \"undefined\")\n opts.prettify = function(num) {\n let factor = Math.pow(10, round);\n return Math.round(num * factor) / factor;\n };\n }\n\n $el.ionRangeSlider(opts);\n\n function getValue() {\n let result = $el.data(\"ionRangeSlider\").result;\n\n // Function for converting numeric value from slider to appropriate type.\n let convert;\n let dataType = $el.data(\"data-type\");\n if (dataType === \"date\") {\n convert = function(val) {\n return formatDateUTC(new Date(+val));\n };\n } else if (dataType === \"datetime\") {\n convert = function(val) {\n // Convert ms to s\n return +val / 1000;\n };\n } else {\n convert = function(val) { return +val; };\n }\n\n if ($el.data(\"ionRangeSlider\").options.type === \"double\") {\n return [convert(result.from), convert(result.to)];\n } else {\n return convert(result.from);\n }\n }\n\n let lastKnownKeys = null;\n\n $el.on(\"change.crosstalkSliderInput\", function(event) {\n if (!$el.data(\"updating\") && !$el.data(\"animating\")) {\n let [from, to] = getValue();\n let keys = [];\n for (let i = 0; i < data.values.length; i++) {\n let val = data.values[i];\n if (val >= from && val <= to) {\n keys.push(data.keys[i]);\n }\n }\n keys.sort();\n ctHandle.set(keys);\n lastKnownKeys = keys;\n }\n });\n\n\n // let $el = $(el);\n // $el.on(\"change\", \"input[type=\"checkbox\"]\", function() {\n // let checked = $el.find(\"input[type=\"checkbox\"]:checked\");\n // if (checked.length === 0) {\n // ctHandle.clear();\n // } else {\n // let keys = {};\n // checked.each(function() {\n // data.map[this.value].forEach(function(key) {\n // keys[key] = true;\n // });\n // });\n // let keyArray = Object.keys(keys);\n // keyArray.sort();\n // ctHandle.set(keyArray);\n // }\n // });\n\n return {\n suspend: function() {\n ctHandle.clear();\n },\n resume: function() {\n if (lastKnownKeys)\n ctHandle.set(lastKnownKeys);\n }\n };\n }\n});\n\n\n// Convert a number to a string with leading zeros\nfunction padZeros(n, digits) {\n let str = n.toString();\n while (str.length < digits)\n str = \"0\" + str;\n return str;\n}\n\n// Given a Date object, return a string in yyyy-mm-dd format, using the\n// UTC date. This may be a day off from the date in the local time zone.\nfunction formatDateUTC(date) {\n if (date instanceof Date) {\n return date.getUTCFullYear() + \"-\" +\n padZeros(date.getUTCMonth()+1, 2) + \"-\" +\n padZeros(date.getUTCDate(), 2);\n\n } else {\n return null;\n }\n}\n",
- "import Events from \"./events\";\nimport grp from \"./group\";\nimport * as util from \"./util\";\n\n/**\n * Use this class to read and write (and listen for changes to) the selection\n * for a Crosstalk group. This is intended to be used for linked brushing.\n *\n * If two (or more) `SelectionHandle` instances in the same webpage share the\n * same group name, they will share the same state. Setting the selection using\n * one `SelectionHandle` instance will result in the `value` property instantly\n * changing across the others, and `\"change\"` event listeners on all instances\n * (including the one that initiated the sending) will fire.\n *\n * @param {string} [group] - The name of the Crosstalk group, or if none,\n * null or undefined (or any other falsy value). This can be changed later\n * via the [SelectionHandle#setGroup](#setGroup) method.\n * @param {Object} [extraInfo] - An object whose properties will be copied to\n * the event object whenever an event is emitted.\n */\nexport class SelectionHandle {\n\n constructor(group = null, extraInfo = null) {\n this._eventRelay = new Events();\n this._emitter = new util.SubscriptionTracker(this._eventRelay);\n\n // Name of the group we're currently tracking, if any. Can change over time.\n this._group = null;\n // The Var we're currently tracking, if any. Can change over time.\n this._var = null;\n // The event handler subscription we currently have on var.on(\"change\").\n this._varOnChangeSub = null;\n\n this._extraInfo = util.extend({ sender: this }, extraInfo);\n\n this.setGroup(group);\n }\n\n /**\n * Changes the Crosstalk group membership of this SelectionHandle. The group\n * being switched away from (if any) will not have its selection value\n * modified as a result of calling `setGroup`, even if this handle was the\n * most recent handle to set the selection of the group.\n *\n * The group being switched to (if any) will also not have its selection value\n * modified as a result of calling `setGroup`. If you want to set the\n * selection value of the new group, call `set` explicitly.\n *\n * @param {string} group - The name of the Crosstalk group, or null (or\n * undefined) to clear the group.\n */\n setGroup(group) {\n // If group is unchanged, do nothing\n if (this._group === group)\n return;\n // Treat null, undefined, and other falsy values the same\n if (!this._group && !group)\n return;\n\n if (this._var) {\n this._var.off(\"change\", this._varOnChangeSub);\n this._var = null;\n this._varOnChangeSub = null;\n }\n\n this._group = group;\n\n if (group) {\n this._var = grp(group).var(\"selection\");\n let sub = this._var.on(\"change\", (e) => {\n this._eventRelay.trigger(\"change\", e, this);\n });\n this._varOnChangeSub = sub;\n }\n }\n\n /**\n * Retrieves the current selection for the group represented by this\n * `SelectionHandle`.\n *\n * - If no selection is active, then this value will be falsy.\n * - If a selection is active, but no data points are selected, then this\n * value will be an empty array.\n * - If a selection is active, and data points are selected, then the keys\n * of the selected data points will be present in the array.\n */\n get value() {\n return this._var ? this._var.get() : null;\n }\n\n /**\n * Combines the given `extraInfo` (if any) with the handle's default\n * `_extraInfo` (if any).\n * @private\n */\n _mergeExtraInfo(extraInfo) {\n // Important incidental effect: shallow clone is returned\n return util.extend({},\n this._extraInfo ? this._extraInfo : null,\n extraInfo ? extraInfo : null);\n }\n\n /**\n * Overwrites the current selection for the group, and raises the `\"change\"`\n * event among all of the group's '`SelectionHandle` instances (including\n * this one).\n *\n * @fires SelectionHandle#change\n * @param {string[]} selectedKeys - Falsy, empty array, or array of keys (see\n * {@link SelectionHandle#value}).\n * @param {Object} [extraInfo] - Extra properties to be included on the event\n * object that's passed to listeners (in addition to any options that were\n * passed into the `SelectionHandle` constructor).\n */\n set(selectedKeys, extraInfo) {\n if (this._var)\n this._var.set(selectedKeys, this._mergeExtraInfo(extraInfo));\n }\n\n /**\n * Overwrites the current selection for the group, and raises the `\"change\"`\n * event among all of the group's '`SelectionHandle` instances (including\n * this one).\n *\n * @fires SelectionHandle#change\n * @param {Object} [extraInfo] - Extra properties to be included on the event\n * object that's passed to listeners (in addition to any that were passed\n * into the `SelectionHandle` constructor).\n */\n clear(extraInfo) {\n if (this._var)\n this.set(void 0, this._mergeExtraInfo(extraInfo));\n }\n\n /**\n * Subscribes to events on this `SelectionHandle`.\n *\n * @param {string} eventType - Indicates the type of events to listen to.\n * Currently, only `\"change\"` is supported.\n * @param {SelectionHandle~listener} listener - The callback function that\n * will be invoked when the event occurs.\n * @return {string} - A token to pass to {@link SelectionHandle#off} to cancel\n * this subscription.\n */\n on(eventType, listener) {\n return this._emitter.on(eventType, listener);\n }\n\n /**\n * Cancels event subscriptions created by {@link SelectionHandle#on}.\n *\n * @param {string} eventType - The type of event to unsubscribe.\n * @param {string|SelectionHandle~listener} listener - Either the callback\n * function previously passed into {@link SelectionHandle#on}, or the\n * string that was returned from {@link SelectionHandle#on}.\n */\n off(eventType, listener) {\n return this._emitter.off(eventType, listener);\n }\n\n /**\n * Shuts down the `SelectionHandle` object.\n *\n * Removes all event listeners that were added through this handle.\n */\n close() {\n this._emitter.removeAllListeners();\n this.setGroup(null);\n }\n}\n\n/**\n * @callback SelectionHandle~listener\n * @param {Object} event - An object containing details of the event. For\n * `\"change\"` events, this includes the properties `value` (the new\n * value of the selection, or `undefined` if no selection is active),\n * `oldValue` (the previous value of the selection), and `sender` (the\n * `SelectionHandle` instance that made the change).\n */\n\n/**\n * @event SelectionHandle#change\n * @type {object}\n * @property {object} value - The new value of the selection, or `undefined`\n * if no selection is active.\n * @property {object} oldValue - The previous value of the selection.\n * @property {SelectionHandle} sender - The `SelectionHandle` instance that\n * changed the value.\n */\n",
- "export function extend(target, ...sources) {\n for (let i = 0; i < sources.length; i++) {\n let src = sources[i];\n if (typeof(src) === \"undefined\" || src === null)\n continue;\n\n for (let key in src) {\n if (src.hasOwnProperty(key)) {\n target[key] = src[key];\n }\n }\n }\n return target;\n}\n\nexport function checkSorted(list) {\n for (let i = 1; i < list.length; i++) {\n if (list[i] <= list[i-1]) {\n throw new Error(\"List is not sorted or contains duplicate\");\n }\n }\n}\n\nexport function diffSortedLists(a, b) {\n let i_a = 0;\n let i_b = 0;\n\n if (!a) a = [];\n if (!b) b = [];\n\n let a_only = [];\n let b_only = [];\n\n checkSorted(a);\n checkSorted(b);\n\n while (i_a < a.length && i_b < b.length) {\n if (a[i_a] === b[i_b]) {\n i_a++;\n i_b++;\n } else if (a[i_a] < b[i_b]) {\n a_only.push(a[i_a++]);\n } else {\n b_only.push(b[i_b++]);\n }\n }\n\n if (i_a < a.length)\n a_only = a_only.concat(a.slice(i_a));\n if (i_b < b.length)\n b_only = b_only.concat(b.slice(i_b));\n return {\n removed: a_only,\n added: b_only\n };\n}\n\n// Convert from wide: { colA: [1,2,3], colB: [4,5,6], ... }\n// to long: [ {colA: 1, colB: 4}, {colA: 2, colB: 5}, ... ]\nexport function dataframeToD3(df) {\n let names = [];\n let length;\n for (let name in df) {\n if (df.hasOwnProperty(name))\n names.push(name);\n if (typeof(df[name]) !== \"object\" || typeof(df[name].length) === \"undefined\") {\n throw new Error(\"All fields must be arrays\");\n } else if (typeof(length) !== \"undefined\" && length !== df[name].length) {\n throw new Error(\"All fields must be arrays of the same length\");\n }\n length = df[name].length;\n }\n let results = [];\n let item;\n for (let row = 0; row < length; row++) {\n item = {};\n for (let col = 0; col < names.length; col++) {\n item[names[col]] = df[names[col]][row];\n }\n results.push(item);\n }\n return results;\n}\n\n/**\n * Keeps track of all event listener additions/removals and lets all active\n * listeners be removed with a single operation.\n *\n * @private\n */\nexport class SubscriptionTracker {\n constructor(emitter) {\n this._emitter = emitter;\n this._subs = {};\n }\n\n on(eventType, listener) {\n let sub = this._emitter.on(eventType, listener);\n this._subs[sub] = eventType;\n return sub;\n }\n\n off(eventType, listener) {\n let sub = this._emitter.off(eventType, listener);\n if (sub) {\n delete this._subs[sub];\n }\n return sub;\n }\n\n removeAllListeners() {\n let current_subs = this._subs;\n this._subs = {};\n Object.keys(current_subs).forEach((sub) => {\n this._emitter.off(current_subs[sub], sub);\n });\n }\n}\n",
- "import Events from \"./events\";\n\nexport default class Var {\n constructor(group, name, /*optional*/ value) {\n this._group = group;\n this._name = name;\n this._value = value;\n this._events = new Events();\n }\n\n get() {\n return this._value;\n }\n\n set(value, /*optional*/ event) {\n if (this._value === value) {\n // Do nothing; the value hasn't changed\n return;\n }\n let oldValue = this._value;\n this._value = value;\n // Alert JavaScript listeners that the value has changed\n let evt = {};\n if (event && typeof(event) === \"object\") {\n for (let k in event) {\n if (event.hasOwnProperty(k))\n evt[k] = event[k];\n }\n }\n evt.oldValue = oldValue;\n evt.value = value;\n this._events.trigger(\"change\", evt, this);\n\n // TODO: Make this extensible, to let arbitrary back-ends know that\n // something has changed\n if (global.Shiny && global.Shiny.onInputChange) {\n global.Shiny.onInputChange(\n \".clientValue-\" +\n (this._group.name !== null ? this._group.name + \"-\" : \"\") +\n this._name,\n typeof(value) === \"undefined\" ? null : value\n );\n }\n }\n\n on(eventType, listener) {\n return this._events.on(eventType, listener);\n }\n\n off(eventType, listener) {\n return this._events.off(eventType, listener);\n }\n}\n"
- ]
-}
\ No newline at end of file
diff --git a/docs/articles/TK03_Forecasting_Using_Time_Series_Signature_files/crosstalk-1.2.0/js/crosstalk.min.js b/docs/articles/TK03_Forecasting_Using_Time_Series_Signature_files/crosstalk-1.2.0/js/crosstalk.min.js
deleted file mode 100644
index b7ec0ac9..00000000
--- a/docs/articles/TK03_Forecasting_Using_Time_Series_Signature_files/crosstalk-1.2.0/js/crosstalk.min.js
+++ /dev/null
@@ -1,2 +0,0 @@
-!function o(u,a,l){function s(n,e){if(!a[n]){if(!u[n]){var t="function"==typeof require&&require;if(!e&&t)return t(n,!0);if(f)return f(n,!0);var r=new Error("Cannot find module '"+n+"'");throw r.code="MODULE_NOT_FOUND",r}var i=a[n]={exports:{}};u[n][0].call(i.exports,function(e){var t=u[n][1][e];return s(t||e)},i,i.exports,o,u,a,l)}return a[n].exports}for(var f="function"==typeof require&&require,e=0;e?@[\\\]^`{|}~])/g,"\\$1")+"']"),r=JSON.parse(n[0].innerText),i=e.factory(t,r);o(t).data("crosstalk-instance",i),o(t).addClass("crosstalk-input-bound")}if(t.Shiny){var e=new t.Shiny.InputBinding,u=t.jQuery;u.extend(e,{find:function(e){return u(e).find(".crosstalk-input")},initialize:function(e){var t,n;u(e).hasClass("crosstalk-input-bound")||(n=o(t=e),Object.keys(r).forEach(function(e){n.hasClass(e)&&!n.hasClass("crosstalk-input-bound")&&i(r[e],t)}))},getId:function(e){return e.id},getValue:function(e){},setValue:function(e,t){},receiveMessage:function(e,t){},subscribe:function(e,t){u(e).data("crosstalk-instance").resume()},unsubscribe:function(e){u(e).data("crosstalk-instance").suspend()}}),t.Shiny.inputBindings.register(e,"crosstalk.inputBinding")}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],7:[function(r,e,t){(function(e){"use strict";var t=function(e){{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}}(r("./input")),n=r("./filter");var a=e.jQuery;t.register({className:"crosstalk-input-checkboxgroup",factory:function(e,r){var i=new n.FilterHandle(r.group),o=void 0,u=a(e);return u.on("change","input[type='checkbox']",function(){var e=u.find("input[type='checkbox']:checked");if(0===e.length)o=null,i.clear();else{var t={};e.each(function(){r.map[this.value].forEach(function(e){t[e]=!0})});var n=Object.keys(t);n.sort(),o=n,i.set(n)}}),{suspend:function(){i.clear()},resume:function(){o&&i.set(o)}}}})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./filter":2,"./input":6}],8:[function(r,e,t){(function(e){"use strict";var t=n(r("./input")),l=n(r("./util")),s=r("./filter");function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}var f=e.jQuery;t.register({className:"crosstalk-input-select",factory:function(e,n){var t=l.dataframeToD3(n.items),r={options:[{value:"",label:"(All)"}].concat(t),valueField:"value",labelField:"label",searchField:"label"},i=f(e).find("select")[0],o=f(i).selectize(r)[0].selectize,u=new s.FilterHandle(n.group),a=void 0;return o.on("change",function(){if(0===o.items.length)a=null,u.clear();else{var t={};o.items.forEach(function(e){n.map[e].forEach(function(e){t[e]=!0})});var e=Object.keys(t);e.sort(),a=e,u.set(e)}}),{suspend:function(){u.clear()},resume:function(){a&&u.set(a)}}}})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./filter":2,"./input":6,"./util":11}],9:[function(n,e,t){(function(e){"use strict";var d=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var u,a=e[Symbol.iterator]();!(r=(u=a.next()).done)&&(n.push(u.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&a.return&&a.return()}finally{if(i)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},t=function(e){{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}}(n("./input")),a=n("./filter");var v=e.jQuery,p=e.strftime;function y(e,t){for(var n=e.toString();n.length {\n this._eventRelay.trigger(\"change\", e, this);\n });\n this._varOnChangeSub = sub;\n }\n }\n\n /**\n * Combine the given `extraInfo` (if any) with the handle's default\n * `_extraInfo` (if any).\n * @private\n */\n _mergeExtraInfo(extraInfo) {\n return util.extend({},\n this._extraInfo ? this._extraInfo : null,\n extraInfo ? extraInfo : null);\n }\n\n /**\n * Close the handle. This clears this handle's contribution to the filter set,\n * and unsubscribes all event listeners.\n */\n close() {\n this._emitter.removeAllListeners();\n this.clear();\n this.setGroup(null);\n }\n\n /**\n * Clear this handle's contribution to the filter set.\n *\n * @param {Object} [extraInfo] - Extra properties to be included on the event\n * object that's passed to listeners (in addition to any options that were\n * passed into the `FilterHandle` constructor).\n * \n * @fires FilterHandle#change\n */\n clear(extraInfo) {\n if (!this._filterSet)\n return;\n this._filterSet.clear(this._id);\n this._onChange(extraInfo);\n }\n\n /**\n * Set this handle's contribution to the filter set. This array should consist\n * of the keys of the rows that _should_ be displayed; any keys that are not\n * present in the array will be considered _filtered out_. Note that multiple\n * `FilterHandle` instances in the group may each contribute an array of keys,\n * and only those keys that appear in _all_ of the arrays make it through the\n * filter.\n *\n * @param {string[]} keys - Empty array, or array of keys. To clear the\n * filter, don't pass an empty array; instead, use the\n * {@link FilterHandle#clear} method.\n * @param {Object} [extraInfo] - Extra properties to be included on the event\n * object that's passed to listeners (in addition to any options that were\n * passed into the `FilterHandle` constructor).\n * \n * @fires FilterHandle#change\n */\n set(keys, extraInfo) {\n if (!this._filterSet)\n return;\n this._filterSet.update(this._id, keys);\n this._onChange(extraInfo);\n }\n\n /**\n * @return {string[]|null} - Either: 1) an array of keys that made it through\n * all of the `FilterHandle` instances, or, 2) `null`, which means no filter\n * is being applied (all data should be displayed).\n */\n get filteredKeys() {\n return this._filterSet ? this._filterSet.value : null;\n }\n\n /**\n * Subscribe to events on this `FilterHandle`.\n *\n * @param {string} eventType - Indicates the type of events to listen to.\n * Currently, only `\"change\"` is supported.\n * @param {FilterHandle~listener} listener - The callback function that\n * will be invoked when the event occurs.\n * @return {string} - A token to pass to {@link FilterHandle#off} to cancel\n * this subscription.\n */\n on(eventType, listener) {\n return this._emitter.on(eventType, listener);\n }\n\n /**\n * Cancel event subscriptions created by {@link FilterHandle#on}.\n *\n * @param {string} eventType - The type of event to unsubscribe.\n * @param {string|FilterHandle~listener} listener - Either the callback\n * function previously passed into {@link FilterHandle#on}, or the\n * string that was returned from {@link FilterHandle#on}.\n */\n off(eventType, listener) {\n return this._emitter.off(eventType, listener);\n }\n\n _onChange(extraInfo) {\n if (!this._filterSet)\n return;\n this._filterVar.set(this._filterSet.value, this._mergeExtraInfo(extraInfo));\n }\n\n /**\n * @callback FilterHandle~listener\n * @param {Object} event - An object containing details of the event. For\n * `\"change\"` events, this includes the properties `value` (the new\n * value of the filter set, or `null` if no filter set is active),\n * `oldValue` (the previous value of the filter set), and `sender` (the\n * `FilterHandle` instance that made the change).\n */\n\n}\n\n/**\n * @event FilterHandle#change\n * @type {object}\n * @property {object} value - The new value of the filter set, or `null`\n * if no filter set is active.\n * @property {object} oldValue - The previous value of the filter set.\n * @property {FilterHandle} sender - The `FilterHandle` instance that\n * changed the value.\n */\n","import { diffSortedLists } from \"./util\";\n\nfunction naturalComparator(a, b) {\n if (a === b) {\n return 0;\n } else if (a < b) {\n return -1;\n } else if (a > b) {\n return 1;\n }\n}\n\n/**\n * @private\n */\nexport default class FilterSet {\n constructor() {\n this.reset();\n }\n\n reset() {\n // Key: handle ID, Value: array of selected keys, or null\n this._handles = {};\n // Key: key string, Value: count of handles that include it\n this._keys = {};\n this._value = null;\n this._activeHandles = 0;\n }\n\n get value() {\n return this._value;\n }\n\n update(handleId, keys) {\n if (keys !== null) {\n keys = keys.slice(0); // clone before sorting\n keys.sort(naturalComparator);\n }\n\n let {added, removed} = diffSortedLists(this._handles[handleId], keys);\n this._handles[handleId] = keys;\n\n for (let i = 0; i < added.length; i++) {\n this._keys[added[i]] = (this._keys[added[i]] || 0) + 1;\n }\n for (let i = 0; i < removed.length; i++) {\n this._keys[removed[i]]--;\n }\n\n this._updateValue(keys);\n }\n\n /**\n * @param {string[]} keys Sorted array of strings that indicate\n * a superset of possible keys.\n * @private\n */\n _updateValue(keys = this._allKeys) {\n let handleCount = Object.keys(this._handles).length;\n if (handleCount === 0) {\n this._value = null;\n } else {\n this._value = [];\n for (let i = 0; i < keys.length; i++) {\n let count = this._keys[keys[i]];\n if (count === handleCount) {\n this._value.push(keys[i]);\n }\n }\n }\n }\n\n clear(handleId) {\n if (typeof(this._handles[handleId]) === \"undefined\") {\n return;\n }\n\n let keys = this._handles[handleId];\n if (!keys) {\n keys = [];\n }\n\n for (let i = 0; i < keys.length; i++) {\n this._keys[keys[i]]--;\n }\n delete this._handles[handleId];\n\n this._updateValue();\n }\n\n get _allKeys() {\n let allKeys = Object.keys(this._keys);\n allKeys.sort(naturalComparator);\n return allKeys;\n }\n}\n","import Var from \"./var\";\n\n// Use a global so that multiple copies of crosstalk.js can be loaded and still\n// have groups behave as singletons across all copies.\nglobal.__crosstalk_groups = global.__crosstalk_groups || {};\nlet groups = global.__crosstalk_groups;\n\nexport default function group(groupName) {\n if (groupName && typeof(groupName) === \"string\") {\n if (!groups.hasOwnProperty(groupName)) {\n groups[groupName] = new Group(groupName);\n }\n return groups[groupName];\n } else if (typeof(groupName) === \"object\" && groupName._vars && groupName.var) {\n // Appears to already be a group object\n return groupName;\n } else if (Array.isArray(groupName) &&\n groupName.length == 1 &&\n typeof(groupName[0]) === \"string\") {\n return group(groupName[0]);\n } else {\n throw new Error(\"Invalid groupName argument\");\n }\n}\n\nclass Group {\n constructor(name) {\n this.name = name;\n this._vars = {};\n }\n\n var(name) {\n if (!name || typeof(name) !== \"string\") {\n throw new Error(\"Invalid var name\");\n }\n\n if (!this._vars.hasOwnProperty(name))\n this._vars[name] = new Var(this, name);\n return this._vars[name];\n }\n\n has(name) {\n if (!name || typeof(name) !== \"string\") {\n throw new Error(\"Invalid var name\");\n }\n\n return this._vars.hasOwnProperty(name);\n }\n}\n","import group from \"./group\";\nimport { SelectionHandle } from \"./selection\";\nimport { FilterHandle } from \"./filter\";\nimport { bind } from \"./input\";\nimport \"./input_selectize\";\nimport \"./input_checkboxgroup\";\nimport \"./input_slider\";\n\nconst defaultGroup = group(\"default\");\n\nfunction var_(name) {\n return defaultGroup.var(name);\n}\n\nfunction has(name) {\n return defaultGroup.has(name);\n}\n\nif (global.Shiny) {\n global.Shiny.addCustomMessageHandler(\"update-client-value\", function(message) {\n if (typeof(message.group) === \"string\") {\n group(message.group).var(message.name).set(message.value);\n } else {\n var_(message.name).set(message.value);\n }\n });\n}\n\nconst crosstalk = {\n group: group,\n var: var_,\n has: has,\n SelectionHandle: SelectionHandle,\n FilterHandle: FilterHandle,\n bind: bind\n};\n\n/**\n * @namespace crosstalk\n */\nexport default crosstalk;\nglobal.crosstalk = crosstalk;\n","let $ = global.jQuery;\n\nlet bindings = {};\n\nexport function register(reg) {\n bindings[reg.className] = reg;\n if (global.document && global.document.readyState !== \"complete\") {\n $(() => {\n bind();\n });\n } else if (global.document) {\n setTimeout(bind, 100);\n }\n}\n\nexport function bind() {\n Object.keys(bindings).forEach(function(className) {\n let binding = bindings[className];\n $(\".\" + binding.className).not(\".crosstalk-input-bound\").each(function(i, el) {\n bindInstance(binding, el);\n });\n });\n}\n\n// Escape jQuery identifier\nfunction $escape(val) {\n return val.replace(/([!\"#$%&'()*+,./:;<=>?@[\\\\\\]^`{|}~])/g, \"\\\\$1\");\n}\n\nfunction bindEl(el) {\n let $el = $(el);\n Object.keys(bindings).forEach(function(className) {\n if ($el.hasClass(className) && !$el.hasClass(\"crosstalk-input-bound\")) {\n let binding = bindings[className];\n bindInstance(binding, el);\n }\n });\n}\n\nfunction bindInstance(binding, el) {\n let jsonEl = $(el).find(\"script[type='application/json'][data-for='\" + $escape(el.id) + \"']\");\n let data = JSON.parse(jsonEl[0].innerText);\n\n let instance = binding.factory(el, data);\n $(el).data(\"crosstalk-instance\", instance);\n $(el).addClass(\"crosstalk-input-bound\");\n}\n\nif (global.Shiny) {\n let inputBinding = new global.Shiny.InputBinding();\n let $ = global.jQuery;\n $.extend(inputBinding, {\n find: function(scope) {\n return $(scope).find(\".crosstalk-input\");\n },\n initialize: function(el) {\n if (!$(el).hasClass(\"crosstalk-input-bound\")) {\n bindEl(el);\n }\n },\n getId: function(el) {\n return el.id;\n },\n getValue: function(el) {\n\n },\n setValue: function(el, value) {\n\n },\n receiveMessage: function(el, data) {\n\n },\n subscribe: function(el, callback) {\n $(el).data(\"crosstalk-instance\").resume();\n },\n unsubscribe: function(el) {\n $(el).data(\"crosstalk-instance\").suspend();\n }\n });\n global.Shiny.inputBindings.register(inputBinding, \"crosstalk.inputBinding\");\n}\n","import * as input from \"./input\";\nimport { FilterHandle } from \"./filter\";\n\nlet $ = global.jQuery;\n\ninput.register({\n className: \"crosstalk-input-checkboxgroup\",\n\n factory: function(el, data) {\n /*\n * map: {\"groupA\": [\"keyA\", \"keyB\", ...], ...}\n * group: \"ct-groupname\"\n */\n let ctHandle = new FilterHandle(data.group);\n\n let lastKnownKeys;\n let $el = $(el);\n $el.on(\"change\", \"input[type='checkbox']\", function() {\n let checked = $el.find(\"input[type='checkbox']:checked\");\n if (checked.length === 0) {\n lastKnownKeys = null;\n ctHandle.clear();\n } else {\n let keys = {};\n checked.each(function() {\n data.map[this.value].forEach(function(key) {\n keys[key] = true;\n });\n });\n let keyArray = Object.keys(keys);\n keyArray.sort();\n lastKnownKeys = keyArray;\n ctHandle.set(keyArray);\n }\n });\n\n return {\n suspend: function() {\n ctHandle.clear();\n },\n resume: function() {\n if (lastKnownKeys)\n ctHandle.set(lastKnownKeys);\n }\n };\n }\n});\n","import * as input from \"./input\";\nimport * as util from \"./util\";\nimport { FilterHandle } from \"./filter\";\n\nlet $ = global.jQuery;\n\ninput.register({\n className: \"crosstalk-input-select\",\n\n factory: function(el, data) {\n /*\n * items: {value: [...], label: [...]}\n * map: {\"groupA\": [\"keyA\", \"keyB\", ...], ...}\n * group: \"ct-groupname\"\n */\n\n let first = [{value: \"\", label: \"(All)\"}];\n let items = util.dataframeToD3(data.items);\n let opts = {\n options: first.concat(items),\n valueField: \"value\",\n labelField: \"label\",\n searchField: \"label\"\n };\n\n let select = $(el).find(\"select\")[0];\n\n let selectize = $(select).selectize(opts)[0].selectize;\n\n let ctHandle = new FilterHandle(data.group);\n\n let lastKnownKeys;\n selectize.on(\"change\", function() {\n if (selectize.items.length === 0) {\n lastKnownKeys = null;\n ctHandle.clear();\n } else {\n let keys = {};\n selectize.items.forEach(function(group) {\n data.map[group].forEach(function(key) {\n keys[key] = true;\n });\n });\n let keyArray = Object.keys(keys);\n keyArray.sort();\n lastKnownKeys = keyArray;\n ctHandle.set(keyArray);\n }\n });\n\n return {\n suspend: function() {\n ctHandle.clear();\n },\n resume: function() {\n if (lastKnownKeys)\n ctHandle.set(lastKnownKeys);\n }\n };\n }\n});\n","import * as input from \"./input\";\nimport { FilterHandle } from \"./filter\";\n\nlet $ = global.jQuery;\nlet strftime = global.strftime;\n\ninput.register({\n className: \"crosstalk-input-slider\",\n\n factory: function(el, data) {\n /*\n * map: {\"groupA\": [\"keyA\", \"keyB\", ...], ...}\n * group: \"ct-groupname\"\n */\n let ctHandle = new FilterHandle(data.group);\n\n let opts = {};\n let $el = $(el).find(\"input\");\n let dataType = $el.data(\"data-type\");\n let timeFormat = $el.data(\"time-format\");\n let round = $el.data(\"round\");\n let timeFormatter;\n\n // Set up formatting functions\n if (dataType === \"date\") {\n timeFormatter = strftime.utc();\n opts.prettify = function(num) {\n return timeFormatter(timeFormat, new Date(num));\n };\n\n } else if (dataType === \"datetime\") {\n let timezone = $el.data(\"timezone\");\n if (timezone)\n timeFormatter = strftime.timezone(timezone);\n else\n timeFormatter = strftime;\n\n opts.prettify = function(num) {\n return timeFormatter(timeFormat, new Date(num));\n };\n } else if (dataType === \"number\") {\n if (typeof round !== \"undefined\")\n opts.prettify = function(num) {\n let factor = Math.pow(10, round);\n return Math.round(num * factor) / factor;\n };\n }\n\n $el.ionRangeSlider(opts);\n\n function getValue() {\n let result = $el.data(\"ionRangeSlider\").result;\n\n // Function for converting numeric value from slider to appropriate type.\n let convert;\n let dataType = $el.data(\"data-type\");\n if (dataType === \"date\") {\n convert = function(val) {\n return formatDateUTC(new Date(+val));\n };\n } else if (dataType === \"datetime\") {\n convert = function(val) {\n // Convert ms to s\n return +val / 1000;\n };\n } else {\n convert = function(val) { return +val; };\n }\n\n if ($el.data(\"ionRangeSlider\").options.type === \"double\") {\n return [convert(result.from), convert(result.to)];\n } else {\n return convert(result.from);\n }\n }\n\n let lastKnownKeys = null;\n\n $el.on(\"change.crosstalkSliderInput\", function(event) {\n if (!$el.data(\"updating\") && !$el.data(\"animating\")) {\n let [from, to] = getValue();\n let keys = [];\n for (let i = 0; i < data.values.length; i++) {\n let val = data.values[i];\n if (val >= from && val <= to) {\n keys.push(data.keys[i]);\n }\n }\n keys.sort();\n ctHandle.set(keys);\n lastKnownKeys = keys;\n }\n });\n\n\n // let $el = $(el);\n // $el.on(\"change\", \"input[type=\"checkbox\"]\", function() {\n // let checked = $el.find(\"input[type=\"checkbox\"]:checked\");\n // if (checked.length === 0) {\n // ctHandle.clear();\n // } else {\n // let keys = {};\n // checked.each(function() {\n // data.map[this.value].forEach(function(key) {\n // keys[key] = true;\n // });\n // });\n // let keyArray = Object.keys(keys);\n // keyArray.sort();\n // ctHandle.set(keyArray);\n // }\n // });\n\n return {\n suspend: function() {\n ctHandle.clear();\n },\n resume: function() {\n if (lastKnownKeys)\n ctHandle.set(lastKnownKeys);\n }\n };\n }\n});\n\n\n// Convert a number to a string with leading zeros\nfunction padZeros(n, digits) {\n let str = n.toString();\n while (str.length < digits)\n str = \"0\" + str;\n return str;\n}\n\n// Given a Date object, return a string in yyyy-mm-dd format, using the\n// UTC date. This may be a day off from the date in the local time zone.\nfunction formatDateUTC(date) {\n if (date instanceof Date) {\n return date.getUTCFullYear() + \"-\" +\n padZeros(date.getUTCMonth()+1, 2) + \"-\" +\n padZeros(date.getUTCDate(), 2);\n\n } else {\n return null;\n }\n}\n","import Events from \"./events\";\nimport grp from \"./group\";\nimport * as util from \"./util\";\n\n/**\n * Use this class to read and write (and listen for changes to) the selection\n * for a Crosstalk group. This is intended to be used for linked brushing.\n *\n * If two (or more) `SelectionHandle` instances in the same webpage share the\n * same group name, they will share the same state. Setting the selection using\n * one `SelectionHandle` instance will result in the `value` property instantly\n * changing across the others, and `\"change\"` event listeners on all instances\n * (including the one that initiated the sending) will fire.\n *\n * @param {string} [group] - The name of the Crosstalk group, or if none,\n * null or undefined (or any other falsy value). This can be changed later\n * via the [SelectionHandle#setGroup](#setGroup) method.\n * @param {Object} [extraInfo] - An object whose properties will be copied to\n * the event object whenever an event is emitted.\n */\nexport class SelectionHandle {\n\n constructor(group = null, extraInfo = null) {\n this._eventRelay = new Events();\n this._emitter = new util.SubscriptionTracker(this._eventRelay);\n\n // Name of the group we're currently tracking, if any. Can change over time.\n this._group = null;\n // The Var we're currently tracking, if any. Can change over time.\n this._var = null;\n // The event handler subscription we currently have on var.on(\"change\").\n this._varOnChangeSub = null;\n\n this._extraInfo = util.extend({ sender: this }, extraInfo);\n\n this.setGroup(group);\n }\n\n /**\n * Changes the Crosstalk group membership of this SelectionHandle. The group\n * being switched away from (if any) will not have its selection value\n * modified as a result of calling `setGroup`, even if this handle was the\n * most recent handle to set the selection of the group.\n *\n * The group being switched to (if any) will also not have its selection value\n * modified as a result of calling `setGroup`. If you want to set the\n * selection value of the new group, call `set` explicitly.\n *\n * @param {string} group - The name of the Crosstalk group, or null (or\n * undefined) to clear the group.\n */\n setGroup(group) {\n // If group is unchanged, do nothing\n if (this._group === group)\n return;\n // Treat null, undefined, and other falsy values the same\n if (!this._group && !group)\n return;\n\n if (this._var) {\n this._var.off(\"change\", this._varOnChangeSub);\n this._var = null;\n this._varOnChangeSub = null;\n }\n\n this._group = group;\n\n if (group) {\n this._var = grp(group).var(\"selection\");\n let sub = this._var.on(\"change\", (e) => {\n this._eventRelay.trigger(\"change\", e, this);\n });\n this._varOnChangeSub = sub;\n }\n }\n\n /**\n * Retrieves the current selection for the group represented by this\n * `SelectionHandle`.\n *\n * - If no selection is active, then this value will be falsy.\n * - If a selection is active, but no data points are selected, then this\n * value will be an empty array.\n * - If a selection is active, and data points are selected, then the keys\n * of the selected data points will be present in the array.\n */\n get value() {\n return this._var ? this._var.get() : null;\n }\n\n /**\n * Combines the given `extraInfo` (if any) with the handle's default\n * `_extraInfo` (if any).\n * @private\n */\n _mergeExtraInfo(extraInfo) {\n // Important incidental effect: shallow clone is returned\n return util.extend({},\n this._extraInfo ? this._extraInfo : null,\n extraInfo ? extraInfo : null);\n }\n\n /**\n * Overwrites the current selection for the group, and raises the `\"change\"`\n * event among all of the group's '`SelectionHandle` instances (including\n * this one).\n *\n * @fires SelectionHandle#change\n * @param {string[]} selectedKeys - Falsy, empty array, or array of keys (see\n * {@link SelectionHandle#value}).\n * @param {Object} [extraInfo] - Extra properties to be included on the event\n * object that's passed to listeners (in addition to any options that were\n * passed into the `SelectionHandle` constructor).\n */\n set(selectedKeys, extraInfo) {\n if (this._var)\n this._var.set(selectedKeys, this._mergeExtraInfo(extraInfo));\n }\n\n /**\n * Overwrites the current selection for the group, and raises the `\"change\"`\n * event among all of the group's '`SelectionHandle` instances (including\n * this one).\n *\n * @fires SelectionHandle#change\n * @param {Object} [extraInfo] - Extra properties to be included on the event\n * object that's passed to listeners (in addition to any that were passed\n * into the `SelectionHandle` constructor).\n */\n clear(extraInfo) {\n if (this._var)\n this.set(void 0, this._mergeExtraInfo(extraInfo));\n }\n\n /**\n * Subscribes to events on this `SelectionHandle`.\n *\n * @param {string} eventType - Indicates the type of events to listen to.\n * Currently, only `\"change\"` is supported.\n * @param {SelectionHandle~listener} listener - The callback function that\n * will be invoked when the event occurs.\n * @return {string} - A token to pass to {@link SelectionHandle#off} to cancel\n * this subscription.\n */\n on(eventType, listener) {\n return this._emitter.on(eventType, listener);\n }\n\n /**\n * Cancels event subscriptions created by {@link SelectionHandle#on}.\n *\n * @param {string} eventType - The type of event to unsubscribe.\n * @param {string|SelectionHandle~listener} listener - Either the callback\n * function previously passed into {@link SelectionHandle#on}, or the\n * string that was returned from {@link SelectionHandle#on}.\n */\n off(eventType, listener) {\n return this._emitter.off(eventType, listener);\n }\n\n /**\n * Shuts down the `SelectionHandle` object.\n *\n * Removes all event listeners that were added through this handle.\n */\n close() {\n this._emitter.removeAllListeners();\n this.setGroup(null);\n }\n}\n\n/**\n * @callback SelectionHandle~listener\n * @param {Object} event - An object containing details of the event. For\n * `\"change\"` events, this includes the properties `value` (the new\n * value of the selection, or `undefined` if no selection is active),\n * `oldValue` (the previous value of the selection), and `sender` (the\n * `SelectionHandle` instance that made the change).\n */\n\n/**\n * @event SelectionHandle#change\n * @type {object}\n * @property {object} value - The new value of the selection, or `undefined`\n * if no selection is active.\n * @property {object} oldValue - The previous value of the selection.\n * @property {SelectionHandle} sender - The `SelectionHandle` instance that\n * changed the value.\n */\n","export function extend(target, ...sources) {\n for (let i = 0; i < sources.length; i++) {\n let src = sources[i];\n if (typeof(src) === \"undefined\" || src === null)\n continue;\n\n for (let key in src) {\n if (src.hasOwnProperty(key)) {\n target[key] = src[key];\n }\n }\n }\n return target;\n}\n\nexport function checkSorted(list) {\n for (let i = 1; i < list.length; i++) {\n if (list[i] <= list[i-1]) {\n throw new Error(\"List is not sorted or contains duplicate\");\n }\n }\n}\n\nexport function diffSortedLists(a, b) {\n let i_a = 0;\n let i_b = 0;\n\n if (!a) a = [];\n if (!b) b = [];\n\n let a_only = [];\n let b_only = [];\n\n checkSorted(a);\n checkSorted(b);\n\n while (i_a < a.length && i_b < b.length) {\n if (a[i_a] === b[i_b]) {\n i_a++;\n i_b++;\n } else if (a[i_a] < b[i_b]) {\n a_only.push(a[i_a++]);\n } else {\n b_only.push(b[i_b++]);\n }\n }\n\n if (i_a < a.length)\n a_only = a_only.concat(a.slice(i_a));\n if (i_b < b.length)\n b_only = b_only.concat(b.slice(i_b));\n return {\n removed: a_only,\n added: b_only\n };\n}\n\n// Convert from wide: { colA: [1,2,3], colB: [4,5,6], ... }\n// to long: [ {colA: 1, colB: 4}, {colA: 2, colB: 5}, ... ]\nexport function dataframeToD3(df) {\n let names = [];\n let length;\n for (let name in df) {\n if (df.hasOwnProperty(name))\n names.push(name);\n if (typeof(df[name]) !== \"object\" || typeof(df[name].length) === \"undefined\") {\n throw new Error(\"All fields must be arrays\");\n } else if (typeof(length) !== \"undefined\" && length !== df[name].length) {\n throw new Error(\"All fields must be arrays of the same length\");\n }\n length = df[name].length;\n }\n let results = [];\n let item;\n for (let row = 0; row < length; row++) {\n item = {};\n for (let col = 0; col < names.length; col++) {\n item[names[col]] = df[names[col]][row];\n }\n results.push(item);\n }\n return results;\n}\n\n/**\n * Keeps track of all event listener additions/removals and lets all active\n * listeners be removed with a single operation.\n *\n * @private\n */\nexport class SubscriptionTracker {\n constructor(emitter) {\n this._emitter = emitter;\n this._subs = {};\n }\n\n on(eventType, listener) {\n let sub = this._emitter.on(eventType, listener);\n this._subs[sub] = eventType;\n return sub;\n }\n\n off(eventType, listener) {\n let sub = this._emitter.off(eventType, listener);\n if (sub) {\n delete this._subs[sub];\n }\n return sub;\n }\n\n removeAllListeners() {\n let current_subs = this._subs;\n this._subs = {};\n Object.keys(current_subs).forEach((sub) => {\n this._emitter.off(current_subs[sub], sub);\n });\n }\n}\n","import Events from \"./events\";\n\nexport default class Var {\n constructor(group, name, /*optional*/ value) {\n this._group = group;\n this._name = name;\n this._value = value;\n this._events = new Events();\n }\n\n get() {\n return this._value;\n }\n\n set(value, /*optional*/ event) {\n if (this._value === value) {\n // Do nothing; the value hasn't changed\n return;\n }\n let oldValue = this._value;\n this._value = value;\n // Alert JavaScript listeners that the value has changed\n let evt = {};\n if (event && typeof(event) === \"object\") {\n for (let k in event) {\n if (event.hasOwnProperty(k))\n evt[k] = event[k];\n }\n }\n evt.oldValue = oldValue;\n evt.value = value;\n this._events.trigger(\"change\", evt, this);\n\n // TODO: Make this extensible, to let arbitrary back-ends know that\n // something has changed\n if (global.Shiny && global.Shiny.onInputChange) {\n global.Shiny.onInputChange(\n \".clientValue-\" +\n (this._group.name !== null ? this._group.name + \"-\" : \"\") +\n this._name,\n typeof(value) === \"undefined\" ? null : value\n );\n }\n }\n\n on(eventType, listener) {\n return this._events.on(eventType, listener);\n }\n\n off(eventType, listener) {\n return this._events.off(eventType, listener);\n }\n}\n"]}
\ No newline at end of file
diff --git a/docs/articles/TK03_Forecasting_Using_Time_Series_Signature_files/crosstalk-1.2.0/scss/crosstalk.scss b/docs/articles/TK03_Forecasting_Using_Time_Series_Signature_files/crosstalk-1.2.0/scss/crosstalk.scss
deleted file mode 100644
index 35665616..00000000
--- a/docs/articles/TK03_Forecasting_Using_Time_Series_Signature_files/crosstalk-1.2.0/scss/crosstalk.scss
+++ /dev/null
@@ -1,75 +0,0 @@
-/* Adjust margins outwards, so column contents line up with the edges of the
- parent of container-fluid. */
-.container-fluid.crosstalk-bscols {
- margin-left: -30px;
- margin-right: -30px;
- white-space: normal;
-}
-
-/* But don't adjust the margins outwards if we're directly under the body,
- i.e. we were the top-level of something at the console. */
-body > .container-fluid.crosstalk-bscols {
- margin-left: auto;
- margin-right: auto;
-}
-
-.crosstalk-input-checkboxgroup .crosstalk-options-group .crosstalk-options-column {
- display: inline-block;
- padding-right: 12px;
- vertical-align: top;
-}
-
-@media only screen and (max-width:480px) {
- .crosstalk-input-checkboxgroup .crosstalk-options-group .crosstalk-options-column {
- display: block;
- padding-right: inherit;
- }
-}
-
-/* Relevant BS3 styles to make filter_checkbox() look reasonable without Bootstrap */
-.crosstalk-input {
- margin-bottom: 15px; /* a la .form-group */
- .control-label {
- margin-bottom: 0;
- vertical-align: middle;
- }
- input[type="checkbox"] {
- margin: 4px 0 0;
- margin-top: 1px;
- line-height: normal;
- }
- .checkbox {
- position: relative;
- display: block;
- margin-top: 10px;
- margin-bottom: 10px;
- }
- .checkbox > label{
- padding-left: 20px;
- margin-bottom: 0;
- font-weight: 400;
- cursor: pointer;
- }
- .checkbox input[type="checkbox"],
- .checkbox-inline input[type="checkbox"] {
- position: absolute;
- margin-top: 2px;
- margin-left: -20px;
- }
- .checkbox + .checkbox {
- margin-top: -5px;
- }
- .checkbox-inline {
- position: relative;
- display: inline-block;
- padding-left: 20px;
- margin-bottom: 0;
- font-weight: 400;
- vertical-align: middle;
- cursor: pointer;
- }
- .checkbox-inline + .checkbox-inline {
- margin-top: 0;
- margin-left: 10px;
- }
-}
diff --git a/docs/articles/TK03_Forecasting_Using_Time_Series_Signature_files/htmlwidgets-1.5.4/htmlwidgets.js b/docs/articles/TK03_Forecasting_Using_Time_Series_Signature_files/htmlwidgets-1.5.4/htmlwidgets.js
deleted file mode 100644
index da8b2367..00000000
--- a/docs/articles/TK03_Forecasting_Using_Time_Series_Signature_files/htmlwidgets-1.5.4/htmlwidgets.js
+++ /dev/null
@@ -1,903 +0,0 @@
-(function() {
- // If window.HTMLWidgets is already defined, then use it; otherwise create a
- // new object. This allows preceding code to set options that affect the
- // initialization process (though none currently exist).
- window.HTMLWidgets = window.HTMLWidgets || {};
-
- // See if we're running in a viewer pane. If not, we're in a web browser.
- var viewerMode = window.HTMLWidgets.viewerMode =
- /\bviewer_pane=1\b/.test(window.location);
-
- // See if we're running in Shiny mode. If not, it's a static document.
- // Note that static widgets can appear in both Shiny and static modes, but
- // obviously, Shiny widgets can only appear in Shiny apps/documents.
- var shinyMode = window.HTMLWidgets.shinyMode =
- typeof(window.Shiny) !== "undefined" && !!window.Shiny.outputBindings;
-
- // We can't count on jQuery being available, so we implement our own
- // version if necessary.
- function querySelectorAll(scope, selector) {
- if (typeof(jQuery) !== "undefined" && scope instanceof jQuery) {
- return scope.find(selector);
- }
- if (scope.querySelectorAll) {
- return scope.querySelectorAll(selector);
- }
- }
-
- function asArray(value) {
- if (value === null)
- return [];
- if ($.isArray(value))
- return value;
- return [value];
- }
-
- // Implement jQuery's extend
- function extend(target /*, ... */) {
- if (arguments.length == 1) {
- return target;
- }
- for (var i = 1; i < arguments.length; i++) {
- var source = arguments[i];
- for (var prop in source) {
- if (source.hasOwnProperty(prop)) {
- target[prop] = source[prop];
- }
- }
- }
- return target;
- }
-
- // IE8 doesn't support Array.forEach.
- function forEach(values, callback, thisArg) {
- if (values.forEach) {
- values.forEach(callback, thisArg);
- } else {
- for (var i = 0; i < values.length; i++) {
- callback.call(thisArg, values[i], i, values);
- }
- }
- }
-
- // Replaces the specified method with the return value of funcSource.
- //
- // Note that funcSource should not BE the new method, it should be a function
- // that RETURNS the new method. funcSource receives a single argument that is
- // the overridden method, it can be called from the new method. The overridden
- // method can be called like a regular function, it has the target permanently
- // bound to it so "this" will work correctly.
- function overrideMethod(target, methodName, funcSource) {
- var superFunc = target[methodName] || function() {};
- var superFuncBound = function() {
- return superFunc.apply(target, arguments);
- };
- target[methodName] = funcSource(superFuncBound);
- }
-
- // Add a method to delegator that, when invoked, calls
- // delegatee.methodName. If there is no such method on
- // the delegatee, but there was one on delegator before
- // delegateMethod was called, then the original version
- // is invoked instead.
- // For example:
- //
- // var a = {
- // method1: function() { console.log('a1'); }
- // method2: function() { console.log('a2'); }
- // };
- // var b = {
- // method1: function() { console.log('b1'); }
- // };
- // delegateMethod(a, b, "method1");
- // delegateMethod(a, b, "method2");
- // a.method1();
- // a.method2();
- //
- // The output would be "b1", "a2".
- function delegateMethod(delegator, delegatee, methodName) {
- var inherited = delegator[methodName];
- delegator[methodName] = function() {
- var target = delegatee;
- var method = delegatee[methodName];
-
- // The method doesn't exist on the delegatee. Instead,
- // call the method on the delegator, if it exists.
- if (!method) {
- target = delegator;
- method = inherited;
- }
-
- if (method) {
- return method.apply(target, arguments);
- }
- };
- }
-
- // Implement a vague facsimilie of jQuery's data method
- function elementData(el, name, value) {
- if (arguments.length == 2) {
- return el["htmlwidget_data_" + name];
- } else if (arguments.length == 3) {
- el["htmlwidget_data_" + name] = value;
- return el;
- } else {
- throw new Error("Wrong number of arguments for elementData: " +
- arguments.length);
- }
- }
-
- // http://stackoverflow.com/questions/3446170/escape-string-for-use-in-javascript-regex
- function escapeRegExp(str) {
- return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
- }
-
- function hasClass(el, className) {
- var re = new RegExp("\\b" + escapeRegExp(className) + "\\b");
- return re.test(el.className);
- }
-
- // elements - array (or array-like object) of HTML elements
- // className - class name to test for
- // include - if true, only return elements with given className;
- // if false, only return elements *without* given className
- function filterByClass(elements, className, include) {
- var results = [];
- for (var i = 0; i < elements.length; i++) {
- if (hasClass(elements[i], className) == include)
- results.push(elements[i]);
- }
- return results;
- }
-
- function on(obj, eventName, func) {
- if (obj.addEventListener) {
- obj.addEventListener(eventName, func, false);
- } else if (obj.attachEvent) {
- obj.attachEvent(eventName, func);
- }
- }
-
- function off(obj, eventName, func) {
- if (obj.removeEventListener)
- obj.removeEventListener(eventName, func, false);
- else if (obj.detachEvent) {
- obj.detachEvent(eventName, func);
- }
- }
-
- // Translate array of values to top/right/bottom/left, as usual with
- // the "padding" CSS property
- // https://developer.mozilla.org/en-US/docs/Web/CSS/padding
- function unpackPadding(value) {
- if (typeof(value) === "number")
- value = [value];
- if (value.length === 1) {
- return {top: value[0], right: value[0], bottom: value[0], left: value[0]};
- }
- if (value.length === 2) {
- return {top: value[0], right: value[1], bottom: value[0], left: value[1]};
- }
- if (value.length === 3) {
- return {top: value[0], right: value[1], bottom: value[2], left: value[1]};
- }
- if (value.length === 4) {
- return {top: value[0], right: value[1], bottom: value[2], left: value[3]};
- }
- }
-
- // Convert an unpacked padding object to a CSS value
- function paddingToCss(paddingObj) {
- return paddingObj.top + "px " + paddingObj.right + "px " + paddingObj.bottom + "px " + paddingObj.left + "px";
- }
-
- // Makes a number suitable for CSS
- function px(x) {
- if (typeof(x) === "number")
- return x + "px";
- else
- return x;
- }
-
- // Retrieves runtime widget sizing information for an element.
- // The return value is either null, or an object with fill, padding,
- // defaultWidth, defaultHeight fields.
- function sizingPolicy(el) {
- var sizingEl = document.querySelector("script[data-for='" + el.id + "'][type='application/htmlwidget-sizing']");
- if (!sizingEl)
- return null;
- var sp = JSON.parse(sizingEl.textContent || sizingEl.text || "{}");
- if (viewerMode) {
- return sp.viewer;
- } else {
- return sp.browser;
- }
- }
-
- // @param tasks Array of strings (or falsy value, in which case no-op).
- // Each element must be a valid JavaScript expression that yields a
- // function. Or, can be an array of objects with "code" and "data"
- // properties; in this case, the "code" property should be a string
- // of JS that's an expr that yields a function, and "data" should be
- // an object that will be added as an additional argument when that
- // function is called.
- // @param target The object that will be "this" for each function
- // execution.
- // @param args Array of arguments to be passed to the functions. (The
- // same arguments will be passed to all functions.)
- function evalAndRun(tasks, target, args) {
- if (tasks) {
- forEach(tasks, function(task) {
- var theseArgs = args;
- if (typeof(task) === "object") {
- theseArgs = theseArgs.concat([task.data]);
- task = task.code;
- }
- var taskFunc = tryEval(task);
- if (typeof(taskFunc) !== "function") {
- throw new Error("Task must be a function! Source:\n" + task);
- }
- taskFunc.apply(target, theseArgs);
- });
- }
- }
-
- // Attempt eval() both with and without enclosing in parentheses.
- // Note that enclosing coerces a function declaration into
- // an expression that eval() can parse
- // (otherwise, a SyntaxError is thrown)
- function tryEval(code) {
- var result = null;
- try {
- result = eval("(" + code + ")");
- } catch(error) {
- if (!(error instanceof SyntaxError)) {
- throw error;
- }
- try {
- result = eval(code);
- } catch(e) {
- if (e instanceof SyntaxError) {
- throw error;
- } else {
- throw e;
- }
- }
- }
- return result;
- }
-
- function initSizing(el) {
- var sizing = sizingPolicy(el);
- if (!sizing)
- return;
-
- var cel = document.getElementById("htmlwidget_container");
- if (!cel)
- return;
-
- if (typeof(sizing.padding) !== "undefined") {
- document.body.style.margin = "0";
- document.body.style.padding = paddingToCss(unpackPadding(sizing.padding));
- }
-
- if (sizing.fill) {
- document.body.style.overflow = "hidden";
- document.body.style.width = "100%";
- document.body.style.height = "100%";
- document.documentElement.style.width = "100%";
- document.documentElement.style.height = "100%";
- if (cel) {
- cel.style.position = "absolute";
- var pad = unpackPadding(sizing.padding);
- cel.style.top = pad.top + "px";
- cel.style.right = pad.right + "px";
- cel.style.bottom = pad.bottom + "px";
- cel.style.left = pad.left + "px";
- el.style.width = "100%";
- el.style.height = "100%";
- }
-
- return {
- getWidth: function() { return cel.offsetWidth; },
- getHeight: function() { return cel.offsetHeight; }
- };
-
- } else {
- el.style.width = px(sizing.width);
- el.style.height = px(sizing.height);
-
- return {
- getWidth: function() { return el.offsetWidth; },
- getHeight: function() { return el.offsetHeight; }
- };
- }
- }
-
- // Default implementations for methods
- var defaults = {
- find: function(scope) {
- return querySelectorAll(scope, "." + this.name);
- },
- renderError: function(el, err) {
- var $el = $(el);
-
- this.clearError(el);
-
- // Add all these error classes, as Shiny does
- var errClass = "shiny-output-error";
- if (err.type !== null) {
- // use the classes of the error condition as CSS class names
- errClass = errClass + " " + $.map(asArray(err.type), function(type) {
- return errClass + "-" + type;
- }).join(" ");
- }
- errClass = errClass + " htmlwidgets-error";
-
- // Is el inline or block? If inline or inline-block, just display:none it
- // and add an inline error.
- var display = $el.css("display");
- $el.data("restore-display-mode", display);
-
- if (display === "inline" || display === "inline-block") {
- $el.hide();
- if (err.message !== "") {
- var errorSpan = $("").addClass(errClass);
- errorSpan.text(err.message);
- $el.after(errorSpan);
- }
- } else if (display === "block") {
- // If block, add an error just after the el, set visibility:none on the
- // el, and position the error to be on top of the el.
- // Mark it with a unique ID and CSS class so we can remove it later.
- $el.css("visibility", "hidden");
- if (err.message !== "") {
- var errorDiv = $("").addClass(errClass).css("position", "absolute")
- .css("top", el.offsetTop)
- .css("left", el.offsetLeft)
- // setting width can push out the page size, forcing otherwise
- // unnecessary scrollbars to appear and making it impossible for
- // the element to shrink; so use max-width instead
- .css("maxWidth", el.offsetWidth)
- .css("height", el.offsetHeight);
- errorDiv.text(err.message);
- $el.after(errorDiv);
-
- // Really dumb way to keep the size/position of the error in sync with
- // the parent element as the window is resized or whatever.
- var intId = setInterval(function() {
- if (!errorDiv[0].parentElement) {
- clearInterval(intId);
- return;
- }
- errorDiv
- .css("top", el.offsetTop)
- .css("left", el.offsetLeft)
- .css("maxWidth", el.offsetWidth)
- .css("height", el.offsetHeight);
- }, 500);
- }
- }
- },
- clearError: function(el) {
- var $el = $(el);
- var display = $el.data("restore-display-mode");
- $el.data("restore-display-mode", null);
-
- if (display === "inline" || display === "inline-block") {
- if (display)
- $el.css("display", display);
- $(el.nextSibling).filter(".htmlwidgets-error").remove();
- } else if (display === "block"){
- $el.css("visibility", "inherit");
- $(el.nextSibling).filter(".htmlwidgets-error").remove();
- }
- },
- sizing: {}
- };
-
- // Called by widget bindings to register a new type of widget. The definition
- // object can contain the following properties:
- // - name (required) - A string indicating the binding name, which will be
- // used by default as the CSS classname to look for.
- // - initialize (optional) - A function(el) that will be called once per
- // widget element; if a value is returned, it will be passed as the third
- // value to renderValue.
- // - renderValue (required) - A function(el, data, initValue) that will be
- // called with data. Static contexts will cause this to be called once per
- // element; Shiny apps will cause this to be called multiple times per
- // element, as the data changes.
- window.HTMLWidgets.widget = function(definition) {
- if (!definition.name) {
- throw new Error("Widget must have a name");
- }
- if (!definition.type) {
- throw new Error("Widget must have a type");
- }
- // Currently we only support output widgets
- if (definition.type !== "output") {
- throw new Error("Unrecognized widget type '" + definition.type + "'");
- }
- // TODO: Verify that .name is a valid CSS classname
-
- // Support new-style instance-bound definitions. Old-style class-bound
- // definitions have one widget "object" per widget per type/class of
- // widget; the renderValue and resize methods on such widget objects
- // take el and instance arguments, because the widget object can't
- // store them. New-style instance-bound definitions have one widget
- // object per widget instance; the definition that's passed in doesn't
- // provide renderValue or resize methods at all, just the single method
- // factory(el, width, height)
- // which returns an object that has renderValue(x) and resize(w, h).
- // This enables a far more natural programming style for the widget
- // author, who can store per-instance state using either OO-style
- // instance fields or functional-style closure variables (I guess this
- // is in contrast to what can only be called C-style pseudo-OO which is
- // what we required before).
- if (definition.factory) {
- definition = createLegacyDefinitionAdapter(definition);
- }
-
- if (!definition.renderValue) {
- throw new Error("Widget must have a renderValue function");
- }
-
- // For static rendering (non-Shiny), use a simple widget registration
- // scheme. We also use this scheme for Shiny apps/documents that also
- // contain static widgets.
- window.HTMLWidgets.widgets = window.HTMLWidgets.widgets || [];
- // Merge defaults into the definition; don't mutate the original definition.
- var staticBinding = extend({}, defaults, definition);
- overrideMethod(staticBinding, "find", function(superfunc) {
- return function(scope) {
- var results = superfunc(scope);
- // Filter out Shiny outputs, we only want the static kind
- return filterByClass(results, "html-widget-output", false);
- };
- });
- window.HTMLWidgets.widgets.push(staticBinding);
-
- if (shinyMode) {
- // Shiny is running. Register the definition with an output binding.
- // The definition itself will not be the output binding, instead
- // we will make an output binding object that delegates to the
- // definition. This is because we foolishly used the same method
- // name (renderValue) for htmlwidgets definition and Shiny bindings
- // but they actually have quite different semantics (the Shiny
- // bindings receive data that includes lots of metadata that it
- // strips off before calling htmlwidgets renderValue). We can't
- // just ignore the difference because in some widgets it's helpful
- // to call this.renderValue() from inside of resize(), and if
- // we're not delegating, then that call will go to the Shiny
- // version instead of the htmlwidgets version.
-
- // Merge defaults with definition, without mutating either.
- var bindingDef = extend({}, defaults, definition);
-
- // This object will be our actual Shiny binding.
- var shinyBinding = new Shiny.OutputBinding();
-
- // With a few exceptions, we'll want to simply use the bindingDef's
- // version of methods if they are available, otherwise fall back to
- // Shiny's defaults. NOTE: If Shiny's output bindings gain additional
- // methods in the future, and we want them to be overrideable by
- // HTMLWidget binding definitions, then we'll need to add them to this
- // list.
- delegateMethod(shinyBinding, bindingDef, "getId");
- delegateMethod(shinyBinding, bindingDef, "onValueChange");
- delegateMethod(shinyBinding, bindingDef, "onValueError");
- delegateMethod(shinyBinding, bindingDef, "renderError");
- delegateMethod(shinyBinding, bindingDef, "clearError");
- delegateMethod(shinyBinding, bindingDef, "showProgress");
-
- // The find, renderValue, and resize are handled differently, because we
- // want to actually decorate the behavior of the bindingDef methods.
-
- shinyBinding.find = function(scope) {
- var results = bindingDef.find(scope);
-
- // Only return elements that are Shiny outputs, not static ones
- var dynamicResults = results.filter(".html-widget-output");
-
- // It's possible that whatever caused Shiny to think there might be
- // new dynamic outputs, also caused there to be new static outputs.
- // Since there might be lots of different htmlwidgets bindings, we
- // schedule execution for later--no need to staticRender multiple
- // times.
- if (results.length !== dynamicResults.length)
- scheduleStaticRender();
-
- return dynamicResults;
- };
-
- // Wrap renderValue to handle initialization, which unfortunately isn't
- // supported natively by Shiny at the time of this writing.
-
- shinyBinding.renderValue = function(el, data) {
- Shiny.renderDependencies(data.deps);
- // Resolve strings marked as javascript literals to objects
- if (!(data.evals instanceof Array)) data.evals = [data.evals];
- for (var i = 0; data.evals && i < data.evals.length; i++) {
- window.HTMLWidgets.evaluateStringMember(data.x, data.evals[i]);
- }
- if (!bindingDef.renderOnNullValue) {
- if (data.x === null) {
- el.style.visibility = "hidden";
- return;
- } else {
- el.style.visibility = "inherit";
- }
- }
- if (!elementData(el, "initialized")) {
- initSizing(el);
-
- elementData(el, "initialized", true);
- if (bindingDef.initialize) {
- var result = bindingDef.initialize(el, el.offsetWidth,
- el.offsetHeight);
- elementData(el, "init_result", result);
- }
- }
- bindingDef.renderValue(el, data.x, elementData(el, "init_result"));
- evalAndRun(data.jsHooks.render, elementData(el, "init_result"), [el, data.x]);
- };
-
- // Only override resize if bindingDef implements it
- if (bindingDef.resize) {
- shinyBinding.resize = function(el, width, height) {
- // Shiny can call resize before initialize/renderValue have been
- // called, which doesn't make sense for widgets.
- if (elementData(el, "initialized")) {
- bindingDef.resize(el, width, height, elementData(el, "init_result"));
- }
- };
- }
-
- Shiny.outputBindings.register(shinyBinding, bindingDef.name);
- }
- };
-
- var scheduleStaticRenderTimerId = null;
- function scheduleStaticRender() {
- if (!scheduleStaticRenderTimerId) {
- scheduleStaticRenderTimerId = setTimeout(function() {
- scheduleStaticRenderTimerId = null;
- window.HTMLWidgets.staticRender();
- }, 1);
- }
- }
-
- // Render static widgets after the document finishes loading
- // Statically render all elements that are of this widget's class
- window.HTMLWidgets.staticRender = function() {
- var bindings = window.HTMLWidgets.widgets || [];
- forEach(bindings, function(binding) {
- var matches = binding.find(document.documentElement);
- forEach(matches, function(el) {
- var sizeObj = initSizing(el, binding);
-
- if (hasClass(el, "html-widget-static-bound"))
- return;
- el.className = el.className + " html-widget-static-bound";
-
- var initResult;
- if (binding.initialize) {
- initResult = binding.initialize(el,
- sizeObj ? sizeObj.getWidth() : el.offsetWidth,
- sizeObj ? sizeObj.getHeight() : el.offsetHeight
- );
- elementData(el, "init_result", initResult);
- }
-
- if (binding.resize) {
- var lastSize = {
- w: sizeObj ? sizeObj.getWidth() : el.offsetWidth,
- h: sizeObj ? sizeObj.getHeight() : el.offsetHeight
- };
- var resizeHandler = function(e) {
- var size = {
- w: sizeObj ? sizeObj.getWidth() : el.offsetWidth,
- h: sizeObj ? sizeObj.getHeight() : el.offsetHeight
- };
- if (size.w === 0 && size.h === 0)
- return;
- if (size.w === lastSize.w && size.h === lastSize.h)
- return;
- lastSize = size;
- binding.resize(el, size.w, size.h, initResult);
- };
-
- on(window, "resize", resizeHandler);
-
- // This is needed for cases where we're running in a Shiny
- // app, but the widget itself is not a Shiny output, but
- // rather a simple static widget. One example of this is
- // an rmarkdown document that has runtime:shiny and widget
- // that isn't in a render function. Shiny only knows to
- // call resize handlers for Shiny outputs, not for static
- // widgets, so we do it ourselves.
- if (window.jQuery) {
- window.jQuery(document).on(
- "shown.htmlwidgets shown.bs.tab.htmlwidgets shown.bs.collapse.htmlwidgets",
- resizeHandler
- );
- window.jQuery(document).on(
- "hidden.htmlwidgets hidden.bs.tab.htmlwidgets hidden.bs.collapse.htmlwidgets",
- resizeHandler
- );
- }
-
- // This is needed for the specific case of ioslides, which
- // flips slides between display:none and display:block.
- // Ideally we would not have to have ioslide-specific code
- // here, but rather have ioslides raise a generic event,
- // but the rmarkdown package just went to CRAN so the
- // window to getting that fixed may be long.
- if (window.addEventListener) {
- // It's OK to limit this to window.addEventListener
- // browsers because ioslides itself only supports
- // such browsers.
- on(document, "slideenter", resizeHandler);
- on(document, "slideleave", resizeHandler);
- }
- }
-
- var scriptData = document.querySelector("script[data-for='" + el.id + "'][type='application/json']");
- if (scriptData) {
- var data = JSON.parse(scriptData.textContent || scriptData.text);
- // Resolve strings marked as javascript literals to objects
- if (!(data.evals instanceof Array)) data.evals = [data.evals];
- for (var k = 0; data.evals && k < data.evals.length; k++) {
- window.HTMLWidgets.evaluateStringMember(data.x, data.evals[k]);
- }
- binding.renderValue(el, data.x, initResult);
- evalAndRun(data.jsHooks.render, initResult, [el, data.x]);
- }
- });
- });
-
- invokePostRenderHandlers();
- }
-
-
- function has_jQuery3() {
- if (!window.jQuery) {
- return false;
- }
- var $version = window.jQuery.fn.jquery;
- var $major_version = parseInt($version.split(".")[0]);
- return $major_version >= 3;
- }
-
- /*
- / Shiny 1.4 bumped jQuery from 1.x to 3.x which means jQuery's
- / on-ready handler (i.e., $(fn)) is now asyncronous (i.e., it now
- / really means $(setTimeout(fn)).
- / https://jquery.com/upgrade-guide/3.0/#breaking-change-document-ready-handlers-are-now-asynchronous
- /
- / Since Shiny uses $() to schedule initShiny, shiny>=1.4 calls initShiny
- / one tick later than it did before, which means staticRender() is
- / called renderValue() earlier than (advanced) widget authors might be expecting.
- / https://github.com/rstudio/shiny/issues/2630
- /
- / For a concrete example, leaflet has some methods (e.g., updateBounds)
- / which reference Shiny methods registered in initShiny (e.g., setInputValue).
- / Since leaflet is privy to this life-cycle, it knows to use setTimeout() to
- / delay execution of those methods (until Shiny methods are ready)
- / https://github.com/rstudio/leaflet/blob/18ec981/javascript/src/index.js#L266-L268
- /
- / Ideally widget authors wouldn't need to use this setTimeout() hack that
- / leaflet uses to call Shiny methods on a staticRender(). In the long run,
- / the logic initShiny should be broken up so that method registration happens
- / right away, but binding happens later.
- */
- function maybeStaticRenderLater() {
- if (shinyMode && has_jQuery3()) {
- window.jQuery(window.HTMLWidgets.staticRender);
- } else {
- window.HTMLWidgets.staticRender();
- }
- }
-
- if (document.addEventListener) {
- document.addEventListener("DOMContentLoaded", function() {
- document.removeEventListener("DOMContentLoaded", arguments.callee, false);
- maybeStaticRenderLater();
- }, false);
- } else if (document.attachEvent) {
- document.attachEvent("onreadystatechange", function() {
- if (document.readyState === "complete") {
- document.detachEvent("onreadystatechange", arguments.callee);
- maybeStaticRenderLater();
- }
- });
- }
-
-
- window.HTMLWidgets.getAttachmentUrl = function(depname, key) {
- // If no key, default to the first item
- if (typeof(key) === "undefined")
- key = 1;
-
- var link = document.getElementById(depname + "-" + key + "-attachment");
- if (!link) {
- throw new Error("Attachment " + depname + "/" + key + " not found in document");
- }
- return link.getAttribute("href");
- };
-
- window.HTMLWidgets.dataframeToD3 = function(df) {
- var names = [];
- var length;
- for (var name in df) {
- if (df.hasOwnProperty(name))
- names.push(name);
- if (typeof(df[name]) !== "object" || typeof(df[name].length) === "undefined") {
- throw new Error("All fields must be arrays");
- } else if (typeof(length) !== "undefined" && length !== df[name].length) {
- throw new Error("All fields must be arrays of the same length");
- }
- length = df[name].length;
- }
- var results = [];
- var item;
- for (var row = 0; row < length; row++) {
- item = {};
- for (var col = 0; col < names.length; col++) {
- item[names[col]] = df[names[col]][row];
- }
- results.push(item);
- }
- return results;
- };
-
- window.HTMLWidgets.transposeArray2D = function(array) {
- if (array.length === 0) return array;
- var newArray = array[0].map(function(col, i) {
- return array.map(function(row) {
- return row[i]
- })
- });
- return newArray;
- };
- // Split value at splitChar, but allow splitChar to be escaped
- // using escapeChar. Any other characters escaped by escapeChar
- // will be included as usual (including escapeChar itself).
- function splitWithEscape(value, splitChar, escapeChar) {
- var results = [];
- var escapeMode = false;
- var currentResult = "";
- for (var pos = 0; pos < value.length; pos++) {
- if (!escapeMode) {
- if (value[pos] === splitChar) {
- results.push(currentResult);
- currentResult = "";
- } else if (value[pos] === escapeChar) {
- escapeMode = true;
- } else {
- currentResult += value[pos];
- }
- } else {
- currentResult += value[pos];
- escapeMode = false;
- }
- }
- if (currentResult !== "") {
- results.push(currentResult);
- }
- return results;
- }
- // Function authored by Yihui/JJ Allaire
- window.HTMLWidgets.evaluateStringMember = function(o, member) {
- var parts = splitWithEscape(member, '.', '\\');
- for (var i = 0, l = parts.length; i < l; i++) {
- var part = parts[i];
- // part may be a character or 'numeric' member name
- if (o !== null && typeof o === "object" && part in o) {
- if (i == (l - 1)) { // if we are at the end of the line then evalulate
- if (typeof o[part] === "string")
- o[part] = tryEval(o[part]);
- } else { // otherwise continue to next embedded object
- o = o[part];
- }
- }
- }
- };
-
- // Retrieve the HTMLWidget instance (i.e. the return value of an
- // HTMLWidget binding's initialize() or factory() function)
- // associated with an element, or null if none.
- window.HTMLWidgets.getInstance = function(el) {
- return elementData(el, "init_result");
- };
-
- // Finds the first element in the scope that matches the selector,
- // and returns the HTMLWidget instance (i.e. the return value of
- // an HTMLWidget binding's initialize() or factory() function)
- // associated with that element, if any. If no element matches the
- // selector, or the first matching element has no HTMLWidget
- // instance associated with it, then null is returned.
- //
- // The scope argument is optional, and defaults to window.document.
- window.HTMLWidgets.find = function(scope, selector) {
- if (arguments.length == 1) {
- selector = scope;
- scope = document;
- }
-
- var el = scope.querySelector(selector);
- if (el === null) {
- return null;
- } else {
- return window.HTMLWidgets.getInstance(el);
- }
- };
-
- // Finds all elements in the scope that match the selector, and
- // returns the HTMLWidget instances (i.e. the return values of
- // an HTMLWidget binding's initialize() or factory() function)
- // associated with the elements, in an array. If elements that
- // match the selector don't have an associated HTMLWidget
- // instance, the returned array will contain nulls.
- //
- // The scope argument is optional, and defaults to window.document.
- window.HTMLWidgets.findAll = function(scope, selector) {
- if (arguments.length == 1) {
- selector = scope;
- scope = document;
- }
-
- var nodes = scope.querySelectorAll(selector);
- var results = [];
- for (var i = 0; i < nodes.length; i++) {
- results.push(window.HTMLWidgets.getInstance(nodes[i]));
- }
- return results;
- };
-
- var postRenderHandlers = [];
- function invokePostRenderHandlers() {
- while (postRenderHandlers.length) {
- var handler = postRenderHandlers.shift();
- if (handler) {
- handler();
- }
- }
- }
-
- // Register the given callback function to be invoked after the
- // next time static widgets are rendered.
- window.HTMLWidgets.addPostRenderHandler = function(callback) {
- postRenderHandlers.push(callback);
- };
-
- // Takes a new-style instance-bound definition, and returns an
- // old-style class-bound definition. This saves us from having
- // to rewrite all the logic in this file to accomodate both
- // types of definitions.
- function createLegacyDefinitionAdapter(defn) {
- var result = {
- name: defn.name,
- type: defn.type,
- initialize: function(el, width, height) {
- return defn.factory(el, width, height);
- },
- renderValue: function(el, x, instance) {
- return instance.renderValue(x);
- },
- resize: function(el, width, height, instance) {
- return instance.resize(width, height);
- }
- };
-
- if (defn.find)
- result.find = defn.find;
- if (defn.renderError)
- result.renderError = defn.renderError;
- if (defn.clearError)
- result.clearError = defn.clearError;
-
- return result;
- }
-})();
-
diff --git a/docs/articles/TK03_Forecasting_Using_Time_Series_Signature_files/jquery-3.5.1/jquery-AUTHORS.txt b/docs/articles/TK03_Forecasting_Using_Time_Series_Signature_files/jquery-3.5.1/jquery-AUTHORS.txt
deleted file mode 100644
index 06df1a53..00000000
--- a/docs/articles/TK03_Forecasting_Using_Time_Series_Signature_files/jquery-3.5.1/jquery-AUTHORS.txt
+++ /dev/null
@@ -1,357 +0,0 @@
-Authors ordered by first contribution.
-
-John Resig
-Gilles van den Hoven
-Michael Geary
-Stefan Petre
-Yehuda Katz
-Corey Jewett
-Klaus Hartl
-Franck Marcia
-Jörn Zaefferer
-Paul Bakaus
-Brandon Aaron
-Mike Alsup
-Dave Methvin
-Ed Engelhardt
-Sean Catchpole
-Paul Mclanahan
-David Serduke
-Richard D. Worth
-Scott González
-Ariel Flesler
-Cheah Chu Yeow
-Andrew Chalkley
-Fabio Buffoni
-Stefan Bauckmeier
-Jon Evans
-TJ Holowaychuk
-Riccardo De Agostini
-Michael Bensoussan
-Louis-Rémi Babé
-Robert Katić
-Damian Janowski
-Anton Kovalyov
-Dušan B. Jovanovic
-Earle Castledine
-Rich Dougherty
-Kim Dalsgaard
-Andrea Giammarchi
-Fabian Jakobs
-Mark Gibson
-Karl Swedberg
-Justin Meyer
-Ben Alman
-James Padolsey
-David Petersen
-Batiste Bieler
-Jake Archibald
-Alexander Farkas
-Filipe Fortes
-Rick Waldron
-Neeraj Singh
-Paul Irish
-Iraê Carvalho
-Matt Curry
-Michael Monteleone
-Noah Sloan
-Tom Viner
-J. Ryan Stinnett
-Douglas Neiner
-Adam J. Sontag
-Heungsub Lee
-Dave Reed
-Carl Fürstenberg
-Jacob Wright
-Ralph Whitbeck
-unknown
-temp01
-Colin Snover
-Jared Grippe
-Ryan W Tenney
-Alex Sexton
-Pinhook
-Ron Otten
-Jephte Clain
-Anton Matzneller
-Dan Heberden
-Henri Wiechers
-Russell Holbrook
-Julian Aubourg
-Gianni Alessandro Chiappetta
-Scott Jehl
-James Burke
-Jonas Pfenniger
-Xavi Ramirez
-Sylvester Keil
-Brandon Sterne
-Mathias Bynens
-Lee Carpenter
-Timmy Willison <4timmywil@gmail.com>
-Corey Frang
-Digitalxero
-David Murdoch
-Josh Varner
-Charles McNulty
-Jordan Boesch
-Jess Thrysoee
-Michael Murray
-Alexis Abril
-Rob Morgan
-John Firebaugh
-Sam Bisbee
-Gilmore Davidson
-Brian Brennan
-Xavier Montillet
-Daniel Pihlstrom
-Sahab Yazdani
-avaly
-Scott Hughes
-Mike Sherov
-Greg Hazel
-Schalk Neethling
-Denis Knauf
-Timo Tijhof
-Steen Nielsen
-Anton Ryzhov
-Shi Chuan
-Matt Mueller
-Berker Peksag
-Toby Brain
-Justin
-Daniel Herman
-Oleg Gaidarenko
-Rock Hymas
-Richard Gibson
-Rafaël Blais Masson
-cmc3cn <59194618@qq.com>
-Joe Presbrey
-Sindre Sorhus
-Arne de Bree
-Vladislav Zarakovsky
-Andrew E Monat
-Oskari
-Joao Henrique de Andrade Bruni
-tsinha
-Dominik D. Geyer
-Matt Farmer
-Trey Hunner
-Jason Moon
-Jeffery To
-Kris Borchers
-Vladimir Zhuravlev
-Jacob Thornton
-Chad Killingsworth
-Vitya Muhachev
-Nowres Rafid
-David Benjamin
-Alan Plum
-Uri Gilad
-Chris Faulkner
-Marcel Greter
-Elijah Manor
-Daniel Chatfield
-Daniel Gálvez
-Nikita Govorov
-Wesley Walser
-Mike Pennisi
-Matthias Jäggli
-Devin Cooper
-Markus Staab
-Dave Riddle
-Callum Macrae
-Jonathan Sampson
-Benjamin Truyman
-Jay Merrifield
-James Huston
-Sai Lung Wong
-Erick Ruiz de Chávez
-David Bonner
-Allen J Schmidt Jr
-Akintayo Akinwunmi
-MORGAN
-Ismail Khair
-Carl Danley
-Mike Petrovich
-Greg Lavallee
-Tom H Fuertes
-Roland Eckl
-Yiming He
-David Fox
-Bennett Sorbo
-Paul Ramos
-Rod Vagg
-Sebastian Burkhard
-Zachary Adam Kaplan
-Adam Coulombe
-nanto_vi
-nanto
-Danil Somsikov
-Ryunosuke SATO
-Diego Tres
-Jean Boussier
-Andrew Plummer
-Mark Raddatz
-Pascal Borreli
-Isaac Z. Schlueter
-Karl Sieburg
-Nguyen Phuc Lam
-Dmitry Gusev
-Steven Benner
-Li Xudong
-Michał Gołębiowski-Owczarek
-Renato Oliveira dos Santos
-Frederic Junod
-Tom H Fuertes
-Mitch Foley
-ros3cin
-Kyle Robinson Young
-John Paul
-Jason Bedard
-Chris Talkington
-Eddie Monge
-Terry Jones
-Jason Merino
-Dan Burzo
-Jeremy Dunck
-Chris Price
-Guy Bedford
-njhamann
-Goare Mao
-Amey Sakhadeo
-Mike Sidorov
-Anthony Ryan
-Lihan Li
-George Kats
-Dongseok Paeng
-Ronny Springer
-Ilya Kantor
-Marian Sollmann
-Chris Antaki
-David Hong
-Jakob Stoeck
-Christopher Jones