NS7154 From Cell to Society - R Handbook

Author

Dr Richard Clarke

Published

17 November 2025

This handbook covers a five session R course for beginners. Originally written for my MSc Health Psychology students. The course uses a single dataset (the Scottish Health Survey 2022) and aims to build your skills step by step. By the end, you’ll be able to wrangle real data, make your own amazing data visulisations, and run/interpret statistical models.

If you have stumbled across this book by accident or you’ve been sent it as a resources to help you learn please feel free to get in touch with me (Dr Richard Clarke) on rclarke8@glos.ac.uk and I’ll hook you up with the dataset.


This book is interactive

  • Blue boxes: Sometimes you’ll see a blue box on the page. These hide the more advanced asides, dumb jokes, or tangents. They’re optional, but if you’re curious, open them up!

This one is empty but look out for others.

  • Exercises: Along the way you’ll find short exercises to test your knowledge.
    • Some are fill-in-the-blank.

How many sessions are there on this course?

  • Some are multiple choice.

Why am I forcing my students to learn R?

  • When you get the right answer, the box turns green and you’ll get a super satisfying ✅.

  • Solutions: Every exercise has a solution tab you can open if you get stuck.

Learning is all about trying things, making mistakes, and then correcting them. So try and use the solutions code only once you’ve tried to solve the issue your self first.

Is there a pdf version is avaiable?

Sort of, I need to figure out a way to get it to export better. Check back later and I might have solved it.

Warning! There will be errors!

Coding is all about figuring out why something isn’t working and solving the problem. As such you will hit errors. This is a natural part of coding and it does not mean that you are “bad at coding”. Every time I do anything in R I hit errors, i now just read them as memory aids or a guide to how I can get my code running. Don’t let them put you off, you’re here and you’re learning, most people will never even try to learn R (what a lonely sad life’s they must lead :-)).

NS7154 Handbook by Dr Richard Clarke - University of Gloucestershire - rclarke8@glos.ac.uk

Special thanks to Llivia Hales for editing, testing, and session support!