Pre-workshop set-up

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

Important

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.

Pre-requisites

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

Installation

Important

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.

Windows

For Windows, follow the instructions here: https://cran.r-project.org/bin/windows/Rtools/rtools43/rtools.html

macOS

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.

Linux

For Linux, follow the instructions here: https://github.com/stan-dev/rstan/wiki/Configuring-C-Toolchain-for-Linux

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!

Troubleshooting

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.

Tip

This is an RStudio project. You can open it by double clicking on the learnGAM.Rproj file.

Important

Before opening the RStudio project, please remove the .Rprofile file (if you can’t see this file, you have to enable the show hidden files option on your operating system). This will deactivate renv (an R package manager).