Source: https://simonbussy.com/teaching/time-series/time_series_R.pdf