Overview

Each session in this course uses R code for demonstration. All the content is self-contained within a R software package designed for the course and uses notebooks for each session.

If you would like to you can follow the course material without installing any software or running any code. However, if you would like to run the code yourself, you will need to follow the instructions below.

Getting R

  • R is used as the main programming language. Please install at least version: R-4.2.0.
  • RStudio is a popular graphic user interface (GUI). Its Visual Editor provides the best experience of going through this course. Please make sure you update RStudio to the latest version.

Installing additional requirements

Before you get started with the course, you will first need to install the following software.

Installation of the nfidd package

To install the packages needed in the course, including the nfidd package that contains data files and helper functions used throughout, you can use the pak package:

options(repos = c(
  "CRAN" = "https://cloud.r-project.org",
  "stan-dev" = "https://stan-dev.r-universe.dev",
  "epiforecasts" = "https://epiforecasts.r-universe.dev"
))
install.packages("nfidd", dependencies = TRUE)

Then you can check that the installation completed successfully by loading the package into your R session:

library("nfidd")

Accessing the course

To be able to use the code in each session, you will need a local copy of the course material.

  • Directly download the course material:

    Tip
  • Alternatively, if you are familiar with git you can clone the repo.

  • If you prefer, you can also view each session on the website, and copy-paste the code into your own R script. In that case you don’t need to download the material.

    • Tip: if you hover over each code chunk on the website you can use a “Copy” button at the top right corner.

Interacting with a local copy of the course material

A benefit of downloading or cloning all the material is that you can interact with the session files directly.

In this course, all content is written using R Notebooks. This means that we can combine text with code and see the output directly. The notebooks are then directly reproduced on the course website (for example, this page).

To interact with each session in the course, we recommend opening the RStudio Project file (ueifid.RProj) in the ueifid folder you have just downloaded. Then you can choose to:

  • View each session on the website, and copy-paste the code into your own R script.
    • Tip: if you hover over each code chunk on the website you can use a “Copy” button at the top right corner.
  • Open the R Notebook for each session.
    • Each notebook is saved in ueifid/sessions/ as a .qmd file.
    • Execute code with the single green “play” button at the top-right corner of each code chunk (“Run current chunk”). You can also execute code line-by-line using Ctrl/Cmd + Enter.
    • We suggest using “Visual” view for a better experience (top-left of the RStudio pane).