Course: R Programming

  • Course Home
  • Syllabus
  • Lecture Materials
  • Want to stay in touch?

    3 + 2 =  


Except where otherwise indicated, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike License . Your use of this material constitutes acceptance of that license and the conditions of use of materials on this site.

To sign up to take the course online, please visit the Johns Hopkins Data Science Specialization.

Course Description

In this course you will learn how to program in R and how to use R for effective data analysis. You will learn how to install and configure software necessary for a statistical programming environment, discuss generic programming language concepts as they are implemented in a high-level statistical language. The course covers practical issues in statistical computing which includes programming in R, reading data into R, accessing R packages, writing R functions, debugging, and organizing and commenting R code. Topics in statistical data analysis and optimization will provide working examples.


  • Week 1: Overview of R, R data types and objects, reading and writing data
  • Week 2: Control structures, functions, scoping rules, dates and times
  • Week 3: Loop functions, debugging tools
  • Week 4: Simulation, code profiling


There is one quiz every week. The quizzes will all open on the first day of the course but they will be due weekly. So the Week 1 Quiz will be due at the end of the first week and the Week 2 Quiz will be due at the end of the second week, etc.

Programming Assignments

There will be three required programming assignments. The first programming assignment is due at the end of the second week. Subsequent programming assignments are due weekly after that.
Programming Assignments 1 and 3 will be graded via unit tests using a submission script that will compare the output of your functions to the correct output. To access Programming Assignments 1 and 3, click the corresponding link in the left navigation bar.
Programming Assignment 2 will be submitted differently and graded via a peer assessment. To access Programming Assignment 2, click the corresponding link in the left navigation bar.

swirl Programming

In this course, you have the option to use the swirl R package to practice some of the concepts we cover in lectures.
Each lesson that you complete in swirl is worth one extra credit point. However, the maximum number of points you may earn for the assignment is capped at 5. While these lessons will give you valuable practice and you are encouraged to complete as many as possible, please note that they are completely optional and you can get full marks in the class without completing them.
You can find the instructions for how to install and use swirl in the Programming Assignments section of the course under Week 1.