Welcome 👋

This five-day course offers a comprehensive journey in R, from beginner to advanced levels, with a focus on practical data analysis, visualisation, and real-world applications in health data science.

Whatever your background or experience with R — whether you’re a total beginner or have some prior experience — we hope you find this course useful, enjoyable, and the beginning of a rewarding journey using R.

Dates and times

  • Five Mondays, November 2026
  • 13:30–17:00 UK time
  • Live on Zoom
  • Slides and practicals appear here on the day

Each session mixes live lectures and practical exercises, with time for questions throughout.

Joining the course

  • Zoom link and site details. HDR UK will email you the Zoom link and details of this site before the course starts. Please keep that email to hand for each session.

  • Set up R and RStudio beforehand. Please make sure you have a working R environment before the first session. See the Software page for instructions.

  • Questions? For anything about joining or registration, contact HDR UK at learn@hdruk.ac.uk.

Course overview

The course starts with the basics of R, including data types, subsetting, and control flow. We then move on to data manipulation, writing functions, and creating visualisations with ggplot2. Later sessions cover more advanced techniques such as iteration and efficient modelling with purrr and broom. Practical exercises and a mini project provide hands-on experience with health-related datasets, along with dynamic reporting using Quarto.

🐣 Session 1: Getting started with R

Monday 2 November · Beginner

  1. Welcome; what to expect when learning R
  2. Objects and assignment; vectors; data types; missing values
  3. Data frames; importing and exporting data; subsetting
  4. Control flow: running code conditionally with if, else and ifelse()

🐥 Session 2: Writing functions and data manipulation

Monday 9 November · Intermediate 1

  1. Using and writing functions in R
  2. Data manipulation with the tidyverse
    • Pipes; importing data
    • Selecting, filtering and sorting (select, filter, arrange)
    • Creating and modifying columns (mutate)
    • Recoding variables (if_else, case_when)

🐤 Session 3: Working with data

Monday 16 November · Intermediate 2

  1. Keeping an analysis project organised
  2. Merging and appending datasets (left_join, bind_rows)
  3. Reshaping data between ‘wide’ and ‘long’ formats (pivot_longer, pivot_wider)
  4. Grouping and summarising (group_by, summarise)

🐔 Session 4: Visualisation, reporting and dates

Monday 23 November · Advanced

  1. Creating plots with ggplot2
  2. Dynamic reporting with Quarto
  3. Working with dates and times
  4. Mini project: introduction

🦅 Session 5: Efficient iteration and reusable code

Monday 30 November · Advanced

  1. Mini project: walkthrough and questions
  2. Working efficiently with lists; introduction to purrr
  3. Fitting many models at once with purrr and broom
  4. Programming with data frames: applying the same operation to many columns with across(); writing your own reusable dplyr and tidyr functions
  5. Efficient text manipulation with regular expressions

This outline is indicative. In practice we adjust the pace to suit the group, so topics may shift slightly between sessions.