diff --git a/DESCRIPTION b/DESCRIPTION index ed26c67a..9a494d4e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -44,10 +44,10 @@ Imports: tsfeatures, hms, assertthat, - generics + generics, + tidymodels Suggests: modeltime, - tidymodels, glmnet, workflows, parsnip, diff --git a/tests/testthat.R b/tests/testthat.R index cb842e63..c1209b3b 100644 --- a/tests/testthat.R +++ b/tests/testthat.R @@ -1,19 +1,24 @@ -library(testthat) -library(timetk) -library(dplyr) -library(tidyr) -library(ggplot2) -library(stringr) -library(lubridate) -library(zoo) - # Forecast objects library(forecast) library(fracdiff) library(timeDate) library(tseries) +library(timeSeries) # Feature engineering library(recipes) +# Time Series +library(lubridate) +library(zoo) +library(timetk) + +# Other +library(stringr) +library(dplyr) +library(tidyr) +library(ggplot2) + +library(testthat) + test_check("timetk") diff --git a/tests/testthat/test-recipes-step_timeseries_signature.R b/tests/testthat/test-recipes-step_timeseries_signature.R index be2cd622..f7b97436 100644 --- a/tests/testthat/test-recipes-step_timeseries_signature.R +++ b/tests/testthat/test-recipes-step_timeseries_signature.R @@ -1,7 +1,8 @@ context("Test recipe: step_timeseries_signature()") -FB_tbl <- FANG %>% filter(symbol == "FB") %>% +FB_tbl <- FANG %>% + dplyr::filter(symbol == "FB") %>% mutate(date_2 = date + dyears(1)) rec_obj <- recipe(adjusted ~ ., data = FB_tbl) %>% diff --git a/tests/testthat/test-tk_augment_timeseries.R b/tests/testthat/test-tk_augment_timeseries.R index bcee642d..138c7fb2 100644 --- a/tests/testthat/test-tk_augment_timeseries.R +++ b/tests/testthat/test-tk_augment_timeseries.R @@ -1,7 +1,7 @@ context("Testing tk_augment_timeseries_signature function") FB_tbl <- FANG %>% - filter(symbol == "FB") + dplyr::filter(symbol == "FB") test_tbl <- FB_tbl diff --git a/tests/testthat/test-tk_index.R b/tests/testthat/test-tk_index.R index 9f15bcdc..bdef486d 100644 --- a/tests/testthat/test-tk_index.R +++ b/tests/testthat/test-tk_index.R @@ -1,6 +1,6 @@ context("Testing tk_index") -FB_tbl <- FANG %>% filter(symbol == "FB") +FB_tbl <- FANG %>% dplyr::filter(symbol == "FB") FB_xts <- FB_tbl %>% tk_xts(silent = TRUE) FB_zoo <- FB_tbl %>% tk_zoo(silent = TRUE) FB_zooreg <- FB_tbl %>% tk_zooreg(start = 2015, freq = 252, silent = TRUE) diff --git a/tests/testthat/test-tk_make_timeseries_future-OLD.R b/tests/testthat/test-tk_make_timeseries_future-OLD.R index c8c2d2d7..d9ae66a3 100644 --- a/tests/testthat/test-tk_make_timeseries_future-OLD.R +++ b/tests/testthat/test-tk_make_timeseries_future-OLD.R @@ -56,7 +56,7 @@ test_that("tk_make_future_timeseries(datetime) test returns correct format.", { }) test_date <- FANG %>% - filter(symbol == "FB") %>% + dplyr::filter(symbol == "FB") %>% tk_index() test_that("tk_make_future_timeseries(date) test returns correct format.", { diff --git a/tests/testthat/test-tk_make_timeseries_future.R b/tests/testthat/test-tk_make_timeseries_future.R index 5590089e..90ade561 100644 --- a/tests/testthat/test-tk_make_timeseries_future.R +++ b/tests/testthat/test-tk_make_timeseries_future.R @@ -85,7 +85,7 @@ test_that("tk_make_future_timeseries(date) test returns correct format.", { test_date <- FANG %>% - filter(symbol == "FB") %>% + dplyr::filter(symbol == "FB") %>% tk_index() # DAILY SCALE ---- diff --git a/tests/testthat/test-tk_tbl.R b/tests/testthat/test-tk_tbl.R index 22475ec2..be75c4f2 100644 --- a/tests/testthat/test-tk_tbl.R +++ b/tests/testthat/test-tk_tbl.R @@ -1,6 +1,6 @@ context("Test tk_tbl") -FB_tbl <- FANG %>% filter(symbol == "FB") +FB_tbl <- FANG %>% dplyr::filter(symbol == "FB") # FUNCTION: tk_tbl ----- diff --git a/tests/testthat/test-tk_ts.R b/tests/testthat/test-tk_ts.R index d60f5c00..d3ae9de5 100644 --- a/tests/testthat/test-tk_ts.R +++ b/tests/testthat/test-tk_ts.R @@ -1,6 +1,6 @@ context("Test tk_ts") -FB_tbl <- FANG %>% filter(symbol == "FB") +FB_tbl <- FANG %>% dplyr::filter(symbol == "FB") FB_xts <- tk_xts(FB_tbl, silent = TRUE) FB_zoo <- tk_zoo(FB_tbl, silent = TRUE) diff --git a/tests/testthat/test-tk_xts.R b/tests/testthat/test-tk_xts.R index e43abaca..be0695e1 100644 --- a/tests/testthat/test-tk_xts.R +++ b/tests/testthat/test-tk_xts.R @@ -1,6 +1,6 @@ context("Test tk_xts") -FB_tbl <- FANG %>% filter(symbol == "FB") +FB_tbl <- FANG %>% dplyr::filter(symbol == "FB") FB_zoo <- tk_zoo(FB_tbl, silent = TRUE) # FUNCTION: tk_xts ----- diff --git a/tests/testthat/test-tk_zoo.R b/tests/testthat/test-tk_zoo.R index 0f17aa4c..68c068e9 100644 --- a/tests/testthat/test-tk_zoo.R +++ b/tests/testthat/test-tk_zoo.R @@ -1,6 +1,6 @@ context("Test tk_zoo") -FB_tbl <- FANG %>% filter(symbol == "FB") +FB_tbl <- FANG %>% dplyr::filter(symbol == "FB") FB_xts <- tk_xts(FB_tbl, silent = TRUE) # FUNCTION: tk_zoo ----- diff --git a/tests/testthat/test-tk_zooreg.R b/tests/testthat/test-tk_zooreg.R index 24e5338b..4cbc414c 100644 --- a/tests/testthat/test-tk_zooreg.R +++ b/tests/testthat/test-tk_zooreg.R @@ -1,7 +1,7 @@ library(timetk) context("Test tk_zooreg") -FB_tbl <- FANG %>% filter(symbol == "FB") +FB_tbl <- FANG %>% dplyr::filter(symbol == "FB") FB_xts <- FB_tbl %>% tk_xts(silent = TRUE) # FUNCTION: tk_zooreg -----