R for Health Data Research

Beginner, Intermediate and Advanced

Dr Ewan Carr

Department of Biostatistics & Health Informatics
King’s College London

Course materials 📖

All lectures and practicals can be found at the link below:

Updated throughout the course and available for at least one month after the final session.

Submit your questions 🙋

Click the “Submit a question” link to send me questions during the week. (I won’t check this during the live session).

Each Friday, I will answer any questions received with a short video.

Optional homework 📝

  • The sessions are spread over four weeks, allowing time for the material to sink in before moving on.
  • Some practicals will contain more exercises than we have time for during class.
  • If you have time, you may want to attempt these in your own time, before the next class.

Learning a new programming

language is hard.


Especially when you’re used to another way of working (e.g., Stata, SPSS or Python).


I tried to learn R five times before it stuck.

Expectations 💡

  • Expect confusion. It’s inevitable; you’re not doing anything wrong.
  • Mistakes are normal, even after many years of using R.
  • Allow time; things will take (much) longer at first.
  • It can help to use R for a specific project, before switching completely.

After 16 years of using R, I still:

  • Regularly make mistakes
  • Have to look things up, check the documentation
  • Spend forever tweaking code, and running endless tests, only to discover in the end that the entire problem was caused by a single comma out of place 😭

What this course is about ✅

  • Building confidence in using R for health data science
  • Learning to write, run, and understand R code
  • Working with complex, real-world data — importing, tidying, transforming, and summarising
  • Developing efficient, reproducible workflows in R
  • Moving toward modern, professional programming practice

What this course is not about ❌

  • Statistical modelling or inference
  • Hypothesis tests, regression, or prediction modelling
  • Detailed coverage of specific statistical packages

I’ll touch on these where relevant, but we won’t teach advanced statistics here.

How this course will run ⚙️

This is a large class with a mix of lectures and practical sessions.

During the Lectures 🎓

  • Post questions in the chat.

    (You can message me directly, or the whole class).

  • Listen or type along — whatever works best for you.

During the practicals 💻

  • Post questions in the chat or put a hand up.
  • You’re welcome to unmute and share screen.
  • I’ll use messages in the chat to check progress.
  • I’ll go through the exercises at the end.

After the sessions 🕐

  • Review material and lecture recordings.
  • If you want, have a go at the homework.
  • Send me your questions for the Q&A.
Every question
is helpful

Someone else is almost certainly wondering the same thing.

Learning R is a journey

“If I take one more step, it’ll be the farthest away from home I’ve ever been.”