Time Series Analysis with Applications R code