{"id":22000109,"url":"https://business-science.github.io/timetk/","last_synced_at":"2025-07-23T03:31:59.267Z","repository":{"id":43148870,"uuid":"87742539","full_name":"business-science/timetk","owner":"business-science","description":"Time series analysis in the `tidyverse`","archived":false,"fork":false,"pushed_at":"2024-06-11T15:18:31.000Z","size":117914,"stargazers_count":629,"open_issues_count":37,"forks_count":104,"subscribers_count":37,"default_branch":"master","last_synced_at":"2025-07-10T16:46:12.095Z","etag":null,"topics":["coercion","coercion-functions","data-mining","dplyr","forecast","forecasting","forecasting-models","machine-learning","r-package","series-decomposition","series-signature","tibble","tidy","tidyquant","tidyverse","time","time-series","timeseries"],"latest_commit_sha":null,"homepage":"https://business-science.github.io/timetk/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/business-science.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-09T22:11:02.000Z","updated_at":"2025-07-08T15:30:15.000Z","dependencies_parsed_at":"2023-02-15T10:46:51.732Z","dependency_job_id":"f5c442e6-d6a3-403f-a5b1-611babeb634d","html_url":"https://github.com/business-science/timetk","commit_stats":{"total_commits":646,"total_committers":17,"mean_commits":38.0,"dds":0.07430340557275539,"last_synced_commit":"ba787084ce0962b1e91949913c0dba80d3f05e3c"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/business-science/timetk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/business-science%2Ftimetk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/business-science%2Ftimetk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/business-science%2Ftimetk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/business-science%2Ftimetk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/business-science","download_url":"https://codeload.github.com/business-science/timetk/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/business-science%2Ftimetk/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265606803,"owners_count":23797009,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["coercion","coercion-functions","data-mining","dplyr","forecast","forecasting","forecasting-models","machine-learning","r-package","series-decomposition","series-signature","tibble","tidy","tidyquant","tidyverse","time","time-series","timeseries"],"created_at":"2024-11-29T23:09:12.562Z","updated_at":"2025-07-23T03:31:58.668Z","avatar_url":"https://github.com/business-science.png","language":"R","funding_links":[],"categories":["Libraries"],"sub_categories":["Time Series Analysis"],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, echo = FALSE, message = FALSE, warning=FALSE}\nknitr::opts_chunk$set(\n    message = F, \n    warning = F,\n    collapse = TRUE,\n    comment = \"#\u003e\",\n    fig.path = \"man/figures/README-\", \n    dpi = 100\n)\n```\n\n\n# timetk for R\n\n\u003c!-- badges: start --\u003e\n[![R-CMD-check](https://github.com/business-science/timetk/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/business-science/timetk/actions/workflows/R-CMD-check.yaml)\n[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/timetk)](https://cran.r-project.org/package=timetk)\n![](http://cranlogs.r-pkg.org/badges/timetk?color=brightgreen)\n![](http://cranlogs.r-pkg.org/badges/grand-total/timetk?color=brightgreen)\n[![codecov](https://codecov.io/gh/business-science/timetk/branch/master/graph/badge.svg)](https://app.codecov.io/gh/business-science/timetk)\n\u003c!-- badges: end --\u003e\n\n\n\u003e  Making time series analysis in R easier.\n\nMission: To make time series analysis in R easier, faster, and more enjoyable. \n\n## Installation\n\n_Download the development version with latest features_:\n\n``` {r, eval = FALSE}\nremotes::install_github(\"business-science/timetk\")\n```\n\n_Or, download CRAN approved version_:\n\n```{r, eval = FALSE}\ninstall.packages(\"timetk\")\n```\n\n\n\n## Package Functionality\n\nThere are _many_ R packages for working with Time Series data. Here's how `timetk` compares to the \"tidy\" time series R packages for data visualization, wrangling, and feature engineeering (those that leverage data frames or tibbles). \n\n\n\u003cdiv class = \"comparison\"\u003e\n\n| Task                         | [timetk](https://business-science.github.io/timetk/) | [tsibble](https://tsibble.tidyverts.org/index.html) | [feasts](https://feasts.tidyverts.org/index.html) | [tibbletime (retired)](https://business-science.github.io/tibbletime/) |\n|------------------------------|--------|---------|---------|-------------|\n| __Structure__            |        |         |         |             |             \n| Data Structure               | tibble (tbl)  | tsibble (tbl_ts)| tsibble (tbl_ts) | tibbletime (tbl_time)  |\n| [__Visualization__](https://business-science.github.io/timetk/articles/TK04_Plotting_Time_Series.html)            |        |         |         |             |             \n| Interactive Plots (plotly)   |  ✅  |  :x:  |  :x:  |  :x: | \n| Static Plots (ggplot)        |  ✅  |  :x:  |  ✅   |  :x:  |  \n| [Time Series](https://business-science.github.io/timetk/articles/TK04_Plotting_Time_Series.html)                  |  ✅  |  :x:  |  ✅   |  :x:  |  \n| [Correlation, Seasonality](https://business-science.github.io/timetk/articles/TK05_Plotting_Seasonality_and_Correlation.html)     |  ✅  |  :x:  |  ✅   |  :x:  |  \n| [__Data Wrangling__](https://business-science.github.io/timetk/articles/TK07_Time_Series_Data_Wrangling.html)           |        |         |         |             |             \n| Time-Based Summarization     |  ✅  |  :x:  |  :x:   |  ✅  |  \n| Time-Based Filtering         |  ✅  |  :x:  |  :x:   |  ✅  |  \n| Padding Gaps                 |  ✅  |  ✅  |  :x:   |  :x:  |  \n| Low to High Frequency        |  ✅  |  :x:  |  :x:   |  :x:  |  \n| Imputation                   |  ✅  |  ✅  |  :x:   |  :x:  |  \n| Sliding / Rolling            |  ✅  |  ✅  |  :x:   |  ✅  |  \n| __Machine Learning__            |        |         |         |             |\n| [Time Series Machine Learning](https://business-science.github.io/timetk/articles/TK03_Forecasting_Using_Time_Series_Signature.html)            |  ✅  |  :x:  |  :x:  |  :x:  |  |\n[Anomaly Detection](https://business-science.github.io/timetk/articles/TK08_Automatic_Anomaly_Detection.html)            |  ✅  |  :x:  |  :x:  |  :x:  |  \n| [Clustering](https://business-science.github.io/timetk/articles/TK09_Clustering.html)            |  ✅  |  :x:  |  :x:  |  :x:  |  \n| [__Feature Engineering (recipes)__](https://business-science.github.io/timetk/articles/TK03_Forecasting_Using_Time_Series_Signature.html)  |        |         |         |             |             \n| Date Feature Engineering     |  ✅  |  :x:  |  :x:   |  :x:  |  \n| Holiday Feature Engineering  |  ✅  |  :x:  |  :x:   |  :x:  |  \n| Fourier Series               |  ✅  |  :x:  |  :x:   |  :x:  |  \n| Smoothing \u0026 Rolling          |  ✅  |  :x:  |  :x:   |  :x:  |  \n| Padding                      |  ✅  |  :x:  |  :x:   |  :x:  |  \n| Imputation                   |  ✅  |  :x:  |  :x:   |  :x:  |  \n| __Cross Validation (rsample)__  |        |         |         |             |             \n| [Time Series Cross Validation](https://business-science.github.io/timetk/reference/time_series_cv.html)      |  ✅  |  :x:  |  :x:   |  :x:  |  \n| [Time Series CV Plan Visualization](https://business-science.github.io/timetk/reference/plot_time_series_cv_plan.html) |  ✅  |  :x:  |  :x:   |  :x:  |  \n| __More Awesomeness__         |        |         |         |             |             \n| [Making Time Series (Intelligently)](https://business-science.github.io/timetk/articles/TK02_Time_Series_Date_Sequences.html)  |  ✅  |  ✅  |  :x:   |  ✅  |  \n| [Handling Holidays \u0026 Weekends](https://business-science.github.io/timetk/articles/TK02_Time_Series_Date_Sequences.html)        |  ✅  |  :x:  |  :x:   |  :x:  |  \n| [Class Conversion](https://business-science.github.io/timetk/articles/TK00_Time_Series_Coercion.html)                    |  ✅  |  ✅  |  :x:   |  :x:  |  \n| [Automatic Frequency \u0026 Trend](https://business-science.github.io/timetk/articles/TK06_Automatic_Frequency_And_Trend_Selection.html)         |  ✅  |  :x:  |  :x:   |  :x:  |  \n\n\u003c/div\u003e\n\n\n## Getting Started\n\n- [Visualizing Time Series](https://business-science.github.io/timetk/articles/TK04_Plotting_Time_Series.html)\n\n- [Wrangling Time Series](https://business-science.github.io/timetk/articles/TK07_Time_Series_Data_Wrangling.html)\n\n- [Full Time Series Machine Learning and Feature Engineering Tutorial](https://business-science.github.io/timetk/articles/TK03_Forecasting_Using_Time_Series_Signature.html)  \n\n- [API Documentation](https://business-science.github.io/timetk/) for articles and a [complete list of function references](https://business-science.github.io/timetk/reference/index.html). \n\n\n## Summary\n\nTimetk is an amazing package that is part of the `modeltime` ecosystem for time series analysis and forecasting. The forecasting system is extensive, and it can take a long time to learn: \n\n- Many algorithms\n- Ensembling and Resampling\n- Machine Learning\n- Deep Learning\n- Scalable Modeling: 10,000+ time series\n\nYour probably thinking how am I ever going to learn time series forecasting. Here's the solution that will save you years of struggling. \n\n## Take the High-Performance Forecasting Course\n\n\u003e Become the forecasting expert for your organization\n\n\u003ca href=\"https://university.business-science.io/p/ds4b-203-r-high-performance-time-series-forecasting/\" target=\"_blank\"\u003e\u003cimg src=\"https://www.filepicker.io/api/file/bKyqVAi5Qi64sS05QYLk\" alt=\"High-Performance Time Series Forecasting Course\" width=\"100%\" style=\"box-shadow: 0 0 5px 2px rgba(0, 0, 0, .5);\"/\u003e\u003c/a\u003e\n\n[_High-Performance Time Series Course_](https://university.business-science.io/p/ds4b-203-r-high-performance-time-series-forecasting/)\n\n### Time Series is Changing\n\nTime 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. \n\n __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).\n\n### How to Learn High-Performance Time Series Forecasting\n\nI teach how to build a HPTFS System in my [__High-Performance Time Series Forecasting Course__](https://university.business-science.io/p/ds4b-203-r-high-performance-time-series-forecasting). You will learn:\n\n- __Time Series Machine Learning__ (cutting-edge) with `Modeltime` - 30+ Models (Prophet, ARIMA, XGBoost, Random Forest, \u0026 many more)\n- __Deep Learning__ with `GluonTS` (Competition Winners)\n- __Time Series Preprocessing__, Noise Reduction, \u0026 Anomaly Detection\n- __Feature engineering__ using lagged variables \u0026 external regressors\n- __Hyperparameter Tuning__\n- __Time series cross-validation__\n- __Ensembling__ Multiple Machine Learning \u0026 Univariate Modeling Techniques (Competition Winner)\n- __Scalable Forecasting__ - Forecast 1000+ time series in parallel\n- and more.\n\n\u003cp class=\"text-center\" style=\"font-size:24px;\"\u003e\nBecome the Time Series Expert for your organization.\n\u003c/p\u003e\n\u003cbr\u003e\n\u003cp class=\"text-center\" style=\"font-size:30px;\"\u003e\n\u003ca href=\"https://university.business-science.io/p/ds4b-203-r-high-performance-time-series-forecasting\"\u003eTake the High-Performance Time Series Forecasting Course\u003c/a\u003e\n\u003c/p\u003e\n\n## Acknowledgements\n\nThe `timetk` package wouldn't be possible without other amazing time series packages. \n\n* [stats](https://rdrr.io/r/stats/stats-package.html) - Basically every `timetk` function that uses a period (frequency) argument owes it to `ts()`. \n    - `plot_acf_diagnostics()`: Leverages `stats::acf()`, `stats::pacf()` \u0026 `stats::ccf()`\n    - `plot_stl_diagnostics()`: Leverages `stats::stl()`\n* [lubridate](https://lubridate.tidyverse.org/): `timetk` makes heavy use of `floor_date()`, `ceiling_date()`, and `duration()` for \"time-based phrases\". \n    - Add and Subtract Time (`%+time%` \u0026 `%-time%`): `\"2012-01-01\" %+time% \"1 month 4 days\"` uses `lubridate` to intelligently offset the day\n* [xts](https://github.com/joshuaulrich/xts): Used to calculate periodicity and fast lag automation. \n* [forecast (retired)](https://pkg.robjhyndman.com/forecast/): Possibly my favorite R package of all time. It's based on `ts`, and its predecessor is the `tidyverts` (`fable`, `tsibble`, `feasts`, and `fabletools`). \n    - The `ts_impute_vec()` function for low-level vectorized imputation using STL + Linear Interpolation uses `na.interp()` under the hood. \n    - The `ts_clean_vec()` function for low-level vectorized imputation using STL + Linear Interpolation uses `tsclean()` under the hood.\n    - Box Cox transformation `auto_lambda()` uses `BoxCox.Lambda()`.  \n* [tibbletime (retired)](https://business-science.github.io/tibbletime/): While `timetk` does not import `tibbletime`, it uses much of the innovative functionality to interpret time-based phrases:\n    - `tk_make_timeseries()` - Extends `seq.Date()` and `seq.POSIXt()` using a simple phase like \"2012-02\" to populate the entire time series from start to finish in February 2012.\n    - `filter_by_time()`, `between_time()` - Uses innovative endpoint detection from phrases like \"2012\"\n    - `slidify()` is basically `rollify()` using `slider` (see below).\n* [slider](https://slider.r-lib.org/): A powerful R package that provides a `purrr`-syntax for complex rolling (sliding) calculations. \n    - `slidify()` uses `slider::pslide` under the hood. \n    - `slidify_vec()` uses `slider::slide_vec()` for simple vectorized rolls (slides).\n* [padr](https://edwinth.github.io/padr/): Used for padding time series from low frequency to high frequency and filling in gaps. \n    - The `pad_by_time()` function is a wrapper for `padr::pad()`.\n    - See the `step_ts_pad()` to apply padding as a preprocessing recipe!\n* [TSstudio](https://github.com/RamiKrispin/TSstudio): This is the best interactive time series visualization tool out there. It leverages the `ts` system, which is the same system the `forecast` R package uses. A ton of inspiration for visuals came from using `TSstudio`. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/business-science.github.io%2Ftimetk%2F","html_url":"https://awesome.ecosyste.ms/projects/business-science.github.io%2Ftimetk%2F","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/business-science.github.io%2Ftimetk%2F/lists"}