Skip to content

Complete Tutorials

These tutorials were designed to showcase the features of the learnr package — and to teach learners how to use R! Try working through these tutorials to get a sense of the look and feel of a learnr tutorial. Then check out the source code to see how these tutorials were made!

Preview image of Setting Up R
Setting Up R

A tutorial featuring videos and interactive questions to guide a new R user through the installation and set up of everything they'll need to get started with R.

Preview image of Filtering Observations
Filtering Observations

An example tutorial teaching a common data transformation: filtering rows of a data frame with dplyr::filter().

Preview image of Summarizing Data
Summarizing Data

An example tutorial where learners are introduced to dplyr::summarise(). Along the way, learners also gain practice with the pipe operator, %>%, and dplyr::group_by().

Demo Tutorials

There’s a lot that learnr can do. These tutorials showcase specific learnr features or show you some possibilities that build on other packages designed to work with R Markdown and learnr.

Preview image of learnr: Quiz Questions
learnr: Quiz Questions

A brief introduction to the types of interactive questions you can use in a learnr tutorial with the learnr::question() and learnr::quiz() functions.

Preview image of learnr: slidy layout
learnr: slidy layout

learnr tutorials can even be used in slides! This example tutorial is a short presentation that showcases an interactive exercise that produces interactive visualizations with htmlwidgets.

Preview image of learnr: SQL Exercises
learnr: SQL Exercises

You can use learnr to teach students how to work with databases using interactive SQL exercises. In this example, we describe how to create your own SQL exercises using the gradethis package to check the student's query.

Preview image of sortable: Ranking Questions
sortable: Ranking Questions

The sortable package allows you to create custom HTML widgets with drag-and-drop capabilities that you can even use in learnr tutorials. This tutorial shows you what's possible with sortable and how to add drag-and-drop questions to your tutorials.

Community Showcase

learnr’s community has built some excellent tutorials and resources for learning data science and programming. Here are just a few highlights. (Please suggest your favorite learnr resources.)

Preview image of DoSStoolkit
DoSStoolkit

The Department of Statistical Sciences (DoSS) toolkit is a free series of open source online modules written by undergraduates, that their fellow students and the public can use to learn the essentials of R.

Preview image of learntidymodels
learntidymodels

Learn tidymodels in the browser or locally in your RStudio IDE!

Preview image of qsslearnr
qsslearnr

This package contains learnr tutorials based on Quantitative Social Science: An Introduction by Kosuke Imai from Princeton University Press.

Preview image of Between the Pipes
Between the Pipes

betweenthepipes is an R package with two tutorials, useful for learning tidyverse basics with hockey data.

Preview image of afrilearnr
afrilearnr

A growing collection of interactive learnr tutorials for learning spatial data analytics while making African maps.

Preview image of RTLedu
RTLedu

RTLedu contains learnr tutorials to accompany the RTL R package by @risktoollib.