Forecasting Using R

R is a programming language for data analysis and visualization. Here I introduce basic commands that should facilitate your understanding of R. You can further enhance your skillset using numerous online resources,24 as well as by applying a trial–and–error approach, which has been my own time-tested routine for mastering R. To the extent that new packages and features are added to R pretty much on a daily basis, there are virtually no limits to how far you can advance your knowledge of this programming language. These notes will get you started—you can go as far as you wish.

We will work in RStudio—the go-to interface for R (available from CRAN). You will need to have installed both, R and RStudio on your devise. RStudio will seamlessly ‘find’ and connect with R.

There are several ‘dialects’ of R coding language. We will primarily rely on data.table, which I find intuitive. The other popular dialect is tidyverse.25 Technically, you don’t necessarily need either of these dialects to get the job done—the base R language would be just enough. But these dialects make things easier, and they are not too difficult to master anyway.


  1. such as R for Data Science↩︎

  2. Forecasting Principles and Practice by Hyndman and Athanasopoulos relies on tidyverse, for example.↩︎