Pre-workshop set-up

Please, follow these instructions carefully to get ready at least one day before the workshop.


Installing the necessary software takes a lot of space on your computer and can take a long of time (1-3 hours depending on the system).

If you are using an externally-managed computer and you wish to just download the materials, check the section below.


Before installing the necessary software, make sure you have installed or updated the following software.



If you have previously installed the C++ toolkit or if you have recently updated your OS, please follow these instructions to reinstall them.

Now you will need to install a few packages and extra software.

Here is an overview of what you will install:

  1. C++ toolchain.

  2. R packages: tidyverse, brms, tidybayes, extraDistr.

1. Install the C++ toolchain

The package brms used in the workshop requires a working C++ toolchain to compile models.


For Windows, follow the instructions here:


For macOS, open the Terminal and write the following line then press enter/return:

xcode-select --install

You’ll see a panel that asks you to install the Xcode Command Line Tools. Install them. Downloading and installation will take 30 to 60 minutes.


For Linux, follow the instructions here:

2. Install the R packages

You need to install the following packages:

install.packages(c("tidyverse", "brms", "tidybayes", "extraDistr"))

It will take several minutes to install the packages, depending on your system and configuration.

If after opening the workshop project in RStudio you get asked to install extra packages or software, please do so.

Check your installation

Run the following in the RStudio Console:

example(stan_model, package = "rstan", run.dontrun = TRUE)

If you see some strange looking text printed in the Console and then fit and fit2 in the Environment, then you are sorted!


If you are having issues with installation, the best place to ask for help are:

Download the materials

All the materials of the workshop (data, code, slides) are in the workshop repository on GitHub.

You have two options:

  1. You can fork the repository and clone it locally if you use git/GitHub.

  2. You can simply download the repo by clicking on the Code button > Download ZIP on GitHub.

The repo is an RStudio project. Before opening the project (by double-clicking on the learnBayes.Rproj file), you should delete the .Rprofile file if you don’t use renv (renv is an R environment manager) to disable renv.