These take-home assignments are designed both as practice material and a long-term support resource. Many researchers experience that the skills learned in an R course fade quickly without repeated use. Each exercise is therefore written both as a learning task now and as a self-guided refresher later.
The assignments include story-driven introductions, guided hints, and structured solutions so you can return to them whenever you need to analyse your own data.
You will also receive separate answer documents. We strongly recommend you first complete the assignments yourself and only consult the answers afterwards or if you are really stuck. Treat the answer key as a check and learning aid, not a shortcut.
The goal of this material is to help you build lasting confidence in R. By working through the assignments step by step, you will:
- Strengthen your understanding of core R syntax and data structures.
- Learn to read, clean, visualise, and interpret real-world data.
- Develop reproducible habits using RMarkdown for transparent analysis.
- Gain a first introduction to statistical reasoning in R through guided examples.
All materials are organised in two top-level folders:
- Exercises/ – student versions of all assignments (with hints in code blocks)
- Answers/ – corresponding instructor/solution versions (same text, filled-in code)
Each folder contains:
- Individual
.Rmdfiles (to open and edit in RStudio) - Pre-rendered PDFs (
all_exercises.pdf/all_answers.pdf) - A front page explaining how to use the materials
If you’ve never worked with RMarkdown (.Rmd) files before, start with the short tutorial included in the repository:
- Exercises/RMarkdown_basics.Rmd
or its pdf version:
- Exercises/RMarkdown_basics.pdf
This mini tutorial explains what RMarkdown is, how to open it in RStudio, how to “knit” the file into a report (HTML or PDF), and why this format is used for the assignments. It takes about 10 minutes to complete and will help you understand the format before beginning Assignment 1.
You can work with these assignments in two ways:
-
Using Git — clone the repository:
git clone https://github.com/AmsterdamUMC/R-course-homework.git
-
Without Git — download the latest ZIP bundles from the
Releases page and unzip them locally.
Then open any .Rmd file in RStudio, fill in the missing code where the comments indicate tasks, and click Knit to create your own PDF (the tutorial tells you how).
Across five assignments, you will learn about the following topics:
- Introduction & patient data: reading, wrangling, plotting
- Penguins: exploratory data analysis and visualisation
- COVID: loops, conditionals, moving averages, flags
- World development – exploring GDP, life expectancy, and CO₂ emissions
- Statistics with penguins: intro to t-tests, ANOVA, effect sizes, diagnostics
Assignment 5 is intentionally a bit more in-depth to provide a gentle introduction to statistics in R.
-
Use the
.Rmdversions for hands-on work. -
The PDFs are great as quick references.
-
The answers are for review only > try the exercises first!
-
If you’re new to RMarkdown, complete the tutorial first.
-
For help in R, use:
?drop_na ??"linear model" example(lm)
This project is licensed under the Apache License 2.0. You are free to use, modify, and distribute these materials for educational and research purposes, provided that proper attribution is given and the same license is included in derivative works. See the LICENSE file for details.
Questions or feedback? Please open an issue on this repository.