R Tutorial with Examples.
R programming tutorial for statistical computing, data analysis, visualisation and research workflows with R and the tidyverse.
Beginner
Start here — no prior experience needed
Getting Started with R
Run R from a script rather than a console, load a dataset into a tibble, and learn the two vector behaviours that surprise everyone coming from Python.
Transforming Data with dplyr
The five verbs that cover most pipeline work, grouped summaries with .by, across() for column sets, and the grouped-tibble trap to watch for.
Reading and Writing Data
CSV with declared types, Parquet with arrow, partitioned datasets queried lazily, and handling a file larger than memory without leaving R.
Tidying and Reshaping Data
Pivot between wide and long with tidyr, split and combine columns, unnest list-columns from JSON, and fill the gaps a time series leaves behind.
Strings, Dates, and Factors
Clean text with stringr, parse and do arithmetic on dates with lubridate, and control category order with forcats — plus a timezone bug to avoid.
Intermediate
For developers with core concepts down
Visualisation with ggplot2
Build plots as layers, read the data ggplot computed behind a histogram or boxplot, facet by a variable, and save a figure that survives a report.
Exploratory Analysis and Statistics
Profile a dataset before trusting it, read a skewed distribution correctly, measure correlation without being fooled, and interpret a t-test honestly.
Modelling with broom and tidymodels
Fit a model, turn its results into a tibble with broom, then build a tidymodels workflow with a proper train/test split and cross-validated metrics.
Advanced
Production-grade patterns for experienced engineers
Databases and dbplyr
Write dplyr and have it execute as SQL on the warehouse — lazy tables, show_query, where translation stops, and choosing R, DuckDB or data.table.
Functions, purrr, and Reproducible Pipelines
Write functions that take column names, iterate with purrr instead of loops, catch failures without stopping, and pin an environment for later.