Learning time series with R