r-epi-coaching

R coaching session materials

02 April 2024

Overview

This page hosts the R tutorial materials for the MSF UK R epi coaching series. This coaching series was developed to support MSF R public health epidemiology users who have already undertaken some R courses and/or have some limited experience of R, but are still at an early stage in their R journey. The materials may also be useful to more experienced R users who want a quick refresher on how to undertake some common analytical tasks in R.

Material source

The content of these sessions is inspired by requests from the coaching group. The tutorials are written by MSF OCA epidemiology advisors and tailored to the needs of the group. Each session typically focuses on a task that one or more members is undertaking during their daily work. The material for each session includes an R markdown document used to create a HTML tutorial, which introduces some brief context (a made up scenario) on which some exercises are based. For each exercise, there is some example code, followed by a ‘your turn’ section, which invites users to try the code themselves using different parameters. There are hint and solution sections at the end of each exercise, which can be revealed on a click if the users need more guidance.

The coaching sessions are usually run as an online interactive session, however the materials can also be used independently for self-learning.

Credits

The style and approach taken by the tutorials follows closely that presented in the Epidemiologist R handbook. For simplicity, in most sessions we have also used the data sets that accompany the handbook for the exercises. We gratefully acknowledge and thank the authors of the Epidemiologist R handbook for this invaluable resource.

Available tutorials

Currently you can access tutorials for the following sessions:

This list will be updated as new sessions become available.

How to use this resource

If you would like to try the tutorials, we suggest you do the following:

  1. Make sure you have the latest versions of R, RStudio and Rtools installed.
  2. Download the materials pack for the relevant session from the links above.
  3. Unzip the folder to a location on your computer (desktop or my documents).
  4. Go to the sub-folder outputs and click on the HTML file inside it (it will open in your internet browser, but does not require an internet connection).
  5. Alternately, if you have a good internet connection, you can access the tutorials directly online from the links above.
  6. Now open the Rstudio project in the root of the session folder.
  7. Create a new R script for the exercises and save it in the subfolder called ‘scripts’.
  8. Follow the introductory section to make sure you have the relevant packages installed, loaded and to import the data
  9. Follow the rest of the sections in sequence to undertake the exercises (note: exercises are displayed in tabs).
  10. If you are stuck, you can click on the arrow next to the hint or solution buttons at the bottom of each exercise to reveal them

If you are an experienced R user and would like to add to this tutorial or the coaching series, please see below for how to contribute.

Github repository

Distribution and licensing

These tutorials are covered by a Gnu General Public Licence version 3 (GPL-3). Please read the licence conditions before using or distributing them.

Contributing

The R code for the tutorials and practical materials on this page are hosted on the MSF UK R epi coaching repository. Revisions and contributions are welcome; please check out your own branch to commit the updates and then submit a pull request. Write access to the repository can be provided on request.

Comments and suggestions

Comments and suggestions are welcome. If you have found a bug in the tutorials, please raise an issue about it on the MSF UK R epi coaching repository issues page, clearly stating the nature of the problem and providing a reproducible example. You can also use the issues page to suggest revisions, new features or topics to cover in future tutorials.

Contacts

This repository is currently maintained by:

If you have any questions about the content of this repository, the best way to contact the maintainers is to create an issue (we will be automatically notified).