Spring 2021 - STAT 361 D200

Laboratory for Advanced R for Data Science (1)

Class Number: 7046

Delivery Method: In Person


  • Course Times + Location:

    Th 3:30 PM – 4:20 PM

  • Prerequisites:

    One of STAT 260 or STAT 341 and one of STAT 302, STAT 305, STAT 350, or ECON 333. CMPT 125 or CMPT 129 is also recommended. Corequisite: STAT 360.



A hands-on application of advanced R programming methods for data science. Using the R concepts covered in STAT 360 and tools for reproducible research, students will work with different data structures, write functions, and debug and optimize the performance of their code.


Course Description

A hands-on application of the R programming language for data science. Using the R concepts covered in STAT 360, students will explore (visualize, transform, and summarize) and wrangle (read and tidy) data. No prior computer programming experience required. 

Course Syllabus

  • Week 1: In-class exercises for setting up R
  • Week 2 and 3: Using ggplot to create plots of different types of data
  • Week 4: Plotting transformed data (e.g., bar plots, smoothed functions)
  • Week 5: Reading in data in different formats
  • Week 6: Cleaning a messy data set
  • Week 7: Linking multiple data sets
  • Week 8: Handling text data
  • Week 9: Handling factors and date and time data
  • Week 10: Writing functions to minimize code length, prevent bugs, and improve readability
  • Week 11: Types of vectors and incorporating vectors in functions
  • Week 12: For loops
  • Week 13: Summary

Mode of Teaching:

  • Lecture: Synchronous
  • Lab: Synchronous
  • Quizzes and Midterm: Synchronous; Date: TBA
  • Final exam: Synchronous; date: TBA
  • Remote invigilation (Zoom, or other approved software) will be used.


With an emphasis on modern methods, this laboratory will provide students with hands-on experience with tools for reproducible research (RStudio and Markdown), data handling, data cleaning, visualization, and exploratory analysis.


  • Assignments 80%
  • Project 20%


Above grading is subject to change.



Access to high-speed internet, webcam


R for Data Science, by Garrett Grolemund and Hadley Wickham
Available online for free at https://r4ds.had.co.nz/

Department Undergraduate Notes:

Students with Disabilities:
Students requiring accommodations as a result of disability must contact the Centre for Accessible Learning 778-782-3112 or csdo@sfu.ca

Tutor Requests:
Students looking for a Tutor should visit http://www.stat.sfu.ca/teaching/need-a-tutor-.html. We accept no responsibility for the consequences of any actions taken related to tutors.

Registrar Notes:


SFU’s Academic Integrity web site http://www.sfu.ca/students/academicintegrity.html is filled with information on what is meant by academic dishonesty, where you can find resources to help with your studies and the consequences of cheating.  Check out the site for more information and videos that help explain the issues in plain English.

Each student is responsible for his or her conduct as it affects the University community.  Academic dishonesty, in whatever form, is ultimately destructive of the values of the University. Furthermore, it is unfair and discouraging to the majority of students who pursue their studies honestly. Scholarly integrity is required of all members of the University. http://www.sfu.ca/policies/gazette/student/s10-01.html


Teaching at SFU in spring 2021 will be conducted primarily through remote methods. There will be in-person course components in a few exceptional cases where this is fundamental to the educational goals of the course. Such course components will be clearly identified at registration, as will course components that will be “live” (synchronous) vs. at your own pace (asynchronous). Enrollment acknowledges that remote study may entail different modes of learning, interaction with your instructor, and ways of getting feedback on your work than may be the case for in-person classes. To ensure you can access all course materials, we recommend you have access to a computer with a microphone and camera, and the internet. In some cases your instructor may use Zoom or other means requiring a camera and microphone to invigilate exams. If proctoring software will be used, this will be confirmed in the first week of class.

Students with hidden or visible disabilities who believe they may need class or exam accommodations, including in the current context of remote learning, are encouraged to register with the SFU Centre for Accessible Learning (caladmin@sfu.ca or 778-782-3112).