Learning Objectives

This course will help you improve quantitative skills and programming skills. We will learn how to use R to handle data sets, to acquire information about the data and to fit time series models.

The first thing you need to do is get you machine ready to run R. You may use your own personal computer or choose to use a virtual machine (VM) from Duke’s VCM or a RStudio Container. In this module you will find information on:

  • Setting up your platform;
    • Setting up a virtual RStudio container;
    • A software installation guide to run R and RStudio for Mac and PC users; and
    • How to link RStudio and our class Github repository. If you don’t have prior GitHub experience, you can simply use Github to download code and data. You will not be required to fork and/or clone the class repository.
  • Discuss the basics of Time Series Analysis (TSA): background, motivation, definition, components, etc;
  • Go over R and RStudio basics such as how to install packages, importing and exporting data, making plots;
  • Introduce best practices on coding: creating well commented scripts, loading packages, adding header.


Here are the slide decks used in class.

L1 - Course Overview and Introductions
L2 - Intro to TSA, R and RStudio

Resources to get your platform ready

  • Option 1: Using your personal machine

    This option has distinct guides depending on which operating system you use.

    Guide for Windows users

    Guide for Mac users

  • Option 2: Using RStudio container (preferred option)

    A “container” is a web-based resource pre-configured to run all the software you need, but only that software. RStudio will work and appear just as they would on a typical desktop machine. No installation required. You just need to set it up.

    1. Navigate to https://cmgr.oit.duke.edu/containers and log in.
    2. Click on the reserve RStudio button.

Resources for linking GitHub and RStudio (optional)

No matter which option you choose to run R, you also have the choice to link RStudio and Git to leverage version control and easily download scripts, data and any updates I make to the class repository. Here is a guide to Setting Up GitHub and a guide to Getting Started with Github .

Resources for Intro to Time Series

Intro to TSA in R

Recordings (optional)

  • Video 1: R markdown (.Rmd) basics
  • Video 2: Intro to time series analysis
  • Video 3: Intro to R and RStudio


Go over the material under resouces and make sure you have R and RStudio ready to be used before we start M2. Complete Assignment 1. The due date for A01 is Friday Jan 19.