Introduction to programming with R
Preface
This is a compilation of the lecture notes from the course CMPE 140: Introduction to Programming for Economics and Management, which I taught at Boğaziçi University between 2017 and 2021.
This course is designed to be an introduction to structured programming using the R language. As such, we discuss only the core language. We also discuss basic visualization, data analysis, and regression analysis. However, advanced libraries for doing data science (the so-called tidyverse) is out of the scope of these notes.
There are many good books about using R for the purpose of data science. However, they are mainly aimed at users who have a background in other coding languages, or mature programmers with a specific data task in mind. Books that teach R as a first programming language are rare. Two books I have particularly found useful are Matloff’s The Art of R Programming1 and Davies’ The Book of R2.
1 Norman Matloff, The Art of R Programming. No Starch Press, 2011.
2 Tilman M. Davies, The Book of R. No Starch Press, 2016.
Although far from being either complete or perfect, I hope these notes could be useful to novice R programmers.