2 Loading libraries
In order to analyze these data with GAMs, we will use the following libraries:
dplyrandtidyrare great for data wrangling, transforming data, etc.ggplot2is the de facto library to create figuresmgcv(Wood 2017) implements mixed GAM computationsitsadug(van Rij et al. 2017) helps in the interpretation of time-series, and autocorrelated datagratia(Simpson 2021) provides alternative figures based onggplot2and other functions for GAMs.
References
Simpson, Gavin L. 2021. gratia: Graceful “ggplot”-Based Graphics and Other Functions for GAMs Fitted Using “mgcv”. https://CRAN.R-project.org/package=gratia.
van Rij, Jacolien, Martijn Wieling, R. Harald Baayen, and Hedderik van Rijn. 2017. itsadug: Interpreting Time Series and Autocorrelated Data Using GAMMs.
Wood, Simon N. 2017. Generalized Additive Models: An Introduction with r. 2nd ed. CRC press.