Overview

All code for this course will be made available in a public repository (repo) on Github: https://github.com/AlkemaLab/BayesCode.

We will use the open-source software R for analyses and computations, through its user-friendly interface R-studio (https://posit.co/products/open-source/rstudio/). For model fitting, R packages and extensions are used such that all analyses take place in R. Analysis scripts will be provided for example analyses and discussed in recordings.

The remainder of this page contains a workflow for non-Github users, and some resources if you’d like to brush up on your R skills.

Instructions for those new to Github

Github refers to a hosting service for projects that use a version control system (git). Many programming projects, such as R packages, use Github repositories and the git version control system such that several people can work together and contribute to the project. Rstudio has nice functionality to work with and contribute to Github repositories. However, it requires some learning to get started with it. Hence, to avoid too much learning at once, we introduce a workflow that does not require any knowledge or experience with git(hub) for new users. If you are interested in learning more about git and github, some resources are provided below.

When downloading the code for the first time, take the following steps:

  1. Download the repo 
  1. Set up your local folder with your Rstudio project 
  • Place the zipped downloaded file in a place where you can find it again: this directory will contain all your R code for the training

  • Unzip the downloaded file

  • Click on “BayesCode.Rproj” to open your project in R studio

We recommend always to start with opening the project file (to start an R studio session), as opposed to opening just the file you want to use, to have the right set up.

You can add additional files and edit the training files as you want. Just make sure to stick to the folder structure to avoid issues. If you are running into problems after editing a local copy of a file, you can always download a new one and start over.

Code updates/additions:

New modules will be added as the training progresses. To get the code in your local BayesCode folder, you will need to download the new module and add it. 

To do so, we recommend just downloading the entire repository again as per step A above, unzipping, and then selecting the folder that you want to move to your local BayesCode folder. (But if you want, note that you can also download individual files (just click on the file you want, and then there is a download button [downwards arrow] in the top left).

Getting going with git(hub)

Some brief steps:

Once you get going, you may want to learn more. This is a great book: https://happygitwithr.com/

Learning R

Books on R and Rstudio

These books are all freely available online: