R for Applied Researchers
R for the kind of work researchers and policy analysts actually do: data wrangling with the tidyverse, plotting with ggplot2, and modelling with lm and the broom workflow. Twelve modules, every exercise runs real R in your browser via WebR.
12
Modules
~10h 40m
Reading time
Beginner
Level
Self-paced
Format
Hands-on practice environment
Real R in your browser. tidyverse and ggplot2 pre-loaded.
R compiled to WebAssembly via WebR. The three Kenyan datasets are pre-loaded as data frames so you can practice filter(), mutate(), ggplot(), and lm() on real data from the moment you start.
Syllabus
- 01→
Hello, R — vectors are everywhere
Why R is vector-first by default, the assignment arrow, and how to read R’s function help pages.
~35 minModule 01 - 02→
Atomic types and coercion
Numeric, integer, character, logical. NA. Implicit coercion rules and how they bite.
~40 minModule 02 - 03→
Vectors, lists, and matrices
Subsetting with [], [[]], and $; named vs unnamed; matrix arithmetic.
~50 minModule 03 - 04→
Data frames and tibbles
Creating, importing, inspecting. Why tibbles are an improvement and where they break.
~45 minModule 04 - 05→
Functions, control flow, and the apply family
Function definition, if/else, for loops vs apply / sapply / map. When to vectorise.
~50 minModule 05 - 06→
dplyr: filter, select, mutate, summarise
The five verbs of data manipulation, pipe %>% (and |>), and group_by.
~60 minModule 06 - 07→
tidyr: pivot, separate, join
Wide vs long. pivot_longer, pivot_wider. Tidy data principles in practice.
~50 minModule 07 - 08→
ggplot2 grammar of graphics
aes, geom, facets, scales, themes. The layered grammar that makes R the plotting tool of choice.
~65 minModule 08 - 09→
Linear models with lm
lm, summary, broom::tidy. Reading coefficients, residuals, and confidence intervals the R way.
~55 minModule 09 - 10→
Factors and model formulas
Factors and levels, the model formula DSL (y ~ x + z), interactions with *, and contrasts.
~50 minModule 10 - 11→
Reporting with R Markdown / Quarto
How to turn an analysis into a reproducible document. YAML headers, code chunks, parameters.
~50 minModule 11 - 12→
Three real analyses on Kenyan data
Replicate the bank-rates spread, the pension allocation shift, and the M-PESA growth curve in R.
~90 minModule 12
How to use this course
Start with module 01 if the material is new; skip ahead if you have prior exposure. Each module is self-contained but the arc is sequential — the projects in the final module assume the toolkit from modules 1-11. Every module ends with key takeaways and a curated further-reading list with primary sources.