This tutorial is meant to be an approachable introduction to estimating \(R_t\). It’s meant for any and all levels of comfort with writing code.

This tutorial will work best if you spend a little time in advance to get set up. It can take a little time for your computer to install the necessary packages (about 15 minutes). If you’ve never used R before, follow the detailed instructions below for a step-by-step guide to get set up. If you have R and RStudio installed on your computer, feel free to skip ahead to the tutorial.

What is in this repository?

Getting set up

Local set up

The set up process comes in three parts:

  1. Downloading the folder with the necessary code onto your machine. If this document is sitting in your computer in a folder called cste-forecasting-workshop, then you’ve successfully completed this step. If not, look for a file with a *.zip extension in an email. Download and unzip the folder.

    • If you’re comfortable with Git and Github, you can clone the repository from seabbs/cste-forecasting-workshop
  2. Download and install R and Rstudio from this website

  3. Double click on the cste-forecasting-workshop.Rproj object in the cste-forecasting-workshop folder to open the R project associated with this tutorial. This should launch R and RStudio. Then, type renv::restore(prompt = FALSE) into the open console (with the > symbol) to download all the necessary packages.

These steps should take around 20 minutes. Once completed, you’re all set up to run the code in tutorial.Rmd as part of the workshop.

Using the cloud

We recommend that you run the code on your own machine. However, if you are unable to do this, there are a few other options.

One option is to use codespaces for which we provide a prebuilt environment (for vscode users this is also available for local use).

Another option is to use binder which we have set up with all the necessary packages installed. This will take a little while to load and is a little unstable but should allow you to run the code in tutorial.Rmd as part of the workshop. Note that this will not save any changes you make to the code and may be slower than running the code on your own machine. If you run into an SSL error you could try editing the address in your URL bar to http (from https) and change your browser security settings for this site. Note: do this at your own risk, and never on a state or federal government computer.

Other resources

If you are interested in finding additional resources for estimating the effective reproduction number or learning about nowcasting in R, explore the following:

EpiNow2 resources

Other packages