From Data to Models with R

A free, open course that takes you from your first line of R to statistical modelling and machine learning — with 340+ exercises, many of which run directly in your browser.
From Data to Models with R · Free · Open · Interactive

Learn R and Statistics,
one step at a time.

A complete university course that takes you from your first line of R code to regression, machine learning and clustering — written for students who do not have a strong background in statistics.

67lessons
340+exercises with solutions
130+run in your browser
4levels, beginner → advanced

Four levels, one path

Each lesson tells you its level, how long it takes and what you should know before starting. Follow the levels in order, or jump to what you need.

Level 1

R foundations

Install R, learn the language, manipulate data with the tidyverse, write functions, import and clean data.

Level 2

Describe & explore

Frequency tables, means and spreads, graphics with ggplot2, correlation — the language of data.

Level 3

Uncertainty & inference

Probability by simulation, sampling distributions, bootstrap, confidence intervals and tests explained without magic.

Level 4

Models & learning

Linear and generalised linear models, tidymodels, trees and ensembles, PCA, clustering and an optional deep-learning track.

How every lesson works

🎯

Clear objectives

What you will be able to do at the end, stated up front.

💡

Intuition first

Every idea starts from a concrete problem and a picture or simulation. The maths is there, in collapsible "Going deeper" boxes.

🔎

How to read the output

Line-by-line guides to what R prints, so you can explain your results in words.

⚠️

Common pitfalls

The misconceptions students (and researchers!) fall into, and how to avoid them.

▶️

Exercises in the browser

Edit and run R code on the page — no installation needed — with hints and solutions.

🧪

Modern, reproducible R

Native pipe, tidyverse, tidymodels, Quarto and project-based workflows.

Who is this for?

  • University students in statistics, economics, biology, psychology, engineering and the social sciences who need R for their courses or thesis.
  • Self-learners who want a structured path rather than scattered tutorials.
  • Instructors looking for open material: the course can support a module of up to 9 ECTS / 72 hours. All sources are on GitHub.

No previous programming or statistics knowledge is assumed. If you can install software on your computer, you are ready.

TipNew here?

Read Start here (10 minutes) to install R, choose an editor and learn how the interactive exercises work. Then open Lesson 1.

Note🇮🇹 Versione italiana

The whole course (except the optional deep-learning track) is also available in Italian: use the EN | IT switch in the top bar, or go directly to the Italian home page.

Back to top