Before diving into analysis, let’s make sure we have all the tools we need to get ready. We need to set up our R environment with the right tools. The tidyverts ecosystem — built around the tidyverse — makes time series analysis intuitive, consistent and visually appealing.
This section will cover installing and loading the packages we will use and checking that your R environment is prepared for a smooth time series work.
We will address the following:
After going through this section your R environment will be a fully-equipped time series analysis workshop. You will understand the role of each major package (tsibble, fable, feasts) and how they interoperate.
More importantly you will get the practical knowledge to install and load them correctly, setting a stable foundation for every analysis you perform in the following chapters.
Allaire, JJ, Yihui Xie, Christophe Dervieux, Jonathan McPherson, Javier Luraschi, Kevin Ushey, Aron Atkins, et al. 2024.
rmarkdown: Dynamic Documents for r.
https://github.com/rstudio/rmarkdown.
Firke, Sam. 2024.
janitor: Simple Tools for Examining and Cleaning Dirty Data.
https://doi.org/10.32614/CRAN.package.janitor.
Frick, Hannah, Fanny Chow, Max Kuhn, Michael Mahoney, Julia Silge, and Hadley Wickham. 2025.
rsample: General Resampling Infrastructure.
https://doi.org/10.32614/CRAN.package.rsample.
Hyndman, Rob. 2024.
Fpp3: Data for "Forecasting: Principles and Practice" (3rd Edition).
https://doi.org/10.32614/CRAN.package.fpp3.
O’Hara-Wild, Mitchell, Cynthia A. Huang, Matthew Kay, and Rob Hyndman. 2025.
ggtime: Grammar of Graphics and Plot Helpers for Time Series Visualization.
https://doi.org/10.32614/CRAN.package.ggtime.
O’Hara-Wild, Mitchell, Rob Hyndman, and Earo Wang. 2024.
fable: Forecasting Models for Tidy Time Series.
https://doi.org/10.32614/CRAN.package.fable.
———. 2025.
feasts: Feature Extraction and Statistics for Time Series.
https://doi.org/10.32614/CRAN.package.feasts.
O’Hara-Wild, Mitchell, Rob Hyndman, Earo Wang, and Rakshitha Godahewa. 2022.
tsibbledata: Diverse Datasets for “tsibble”.
https://doi.org/10.32614/CRAN.package.tsibbledata.
Pedersen, Thomas Lin. 2025.
patchwork: The Composer of Plots.
https://doi.org/10.32614/CRAN.package.patchwork.
R Core Team. 2025.
R: A Language and Environment for Statistical Computing. Vienna, Austria: R Foundation for Statistical Computing.
https://www.R-project.org/.
Vaughan, Davis. 2024.
slider: Sliding Window Functions.
https://doi.org/10.32614/CRAN.package.slider.
Wang, Earo, Dianne Cook, and Rob J Hyndman. 2020.
“A New Tidy Data Structure to Support Exploration and Modeling of Temporal Data.” Journal of Computational and Graphical Statistics 29 (3): 466–78.
https://doi.org/10.1080/10618600.2019.1695624.
Wickham, Hadley, Mara Averick, Jennifer Bryan, Winston Chang, Lucy D’Agostino McGowan, Romain François, Garrett Grolemund, et al. 2019.
“Welcome to the tidyverse.” Journal of Open Source Software 4 (43): 1686.
https://doi.org/10.21105/joss.01686.
Xie, Yihui. 2014. “knitr: A Comprehensive Tool for Reproducible Research in R.” In Implementing Reproducible Computational Research, edited by Victoria Stodden, Friedrich Leisch, and Roger D. Peng. Chapman; Hall/CRC.
———. 2015.
Dynamic Documents with R and Knitr. 2nd ed. Boca Raton, Florida: Chapman; Hall/CRC.
https://yihui.org/knitr/.
———. 2025.
knitr: A General-Purpose Package for Dynamic Report Generation in R.
https://yihui.org/knitr/.
Xie, Yihui, J. J. Allaire, and Garrett Grolemund. 2018.
R Markdown: The Definitive Guide. Boca Raton, Florida: Chapman; Hall/CRC.
https://bookdown.org/yihui/rmarkdown.
Xie, Yihui, Christophe Dervieux, and Emily Riederer. 2020.
R Markdown Cookbook. Boca Raton, Florida: Chapman; Hall/CRC.
https://bookdown.org/yihui/rmarkdown-cookbook.