Programming using R

This is a one day intensive course on R programming techniques. The course is structured as a set of lecture sessions and computer practicals. It mainly covers the basic programming tools in R, such as functions and control structures, i.e. conditional expressions and loops. This course might be benfecial for a wide range of participants e.g., statisticians, biologists, clinicians and postgraduate students.


This course assumes all participants have basic concepts of R, as covered by the 'Introduction to R' course. It is highly recommended that a participant attends the 'Introduction to R', followed by this course. Both courses together form a series titled 'Mastering Data Analysis & Visualisation Using R'.


  • Functions: What is an R function?, how are they structured and used?, how can one understand function’s parameters and how can we create our own functions?
  • Control Structures: Describing how we include control structures into R code.
  • Conditional expressions: Using “if” and “ifelse” structures in R.
  • Loops: Introcuding looping techniques in R, with particular focus on “for”, “repeat” and “while” statements.
  • “apply” family: using “apply”, “lapply”, “tapply”, “mapply” and “sapply” in R.


Dr. Osama Mahmoud, Lecturer in Data Science and Statistics, the Director of UG and PG Data Science programmes at the Department of Mathematical Sciences, University of Essex, UK.


The course slides, R scripts, practical questionas and answers covered in this course can be found on my statcourses github page.


Each course is associated with an R package tailored to combine together the practical sheets with solutions, course notes and training data sets. The R package associated with this course, named 'dsEssex', can be simply installed by running the following code lines into your R session.

# required only once per machine!
if(!require("devtools")) install.packages("devtools")

The package can then be loaded via: