Code
install.packages("remotes")Claudius Gräbner-Radkowitsch
June 16, 2026
June 16, 2026
When learning a programming language, applying new concepts regularly is essential. Without regular practice it is hard to remember — and to find out what you have not yet understood well enough.
The DataScienceExercises package provides a set of interactive exercises for core R topics. Each exercise runs in your browser and gives immediate feedback on your answers. This post explains how to install the package and run exercises.
The exercises use three packages: learnr, gradethis, and DataScienceExercises. All three are installed from GitHub, so you first need the remotes package:
Then install the exercise packages:
The exercises are updated and extended over time. Before starting a practice session, run:
An internet connection is only needed to update — the exercises themselves run offline once installed.
Resource pages on this hub that have associated exercises list the name of the exercise set. To launch one, pass that name to learnr::run_tutorial(). For example, to run the Basics set:
Replace "Basics" with the name of whichever exercise set you want to practice.
If you find a mistake or have an idea for a new exercise, use the issue tracker on GitHub.
Header image: photo by Daniil Komov on Unsplash.
@online{graebner2026-method-and-inquiry,
author = {Gräbner-Radkowitsch, Claudius},
title = {Method and {Inquiry}},
date = {2026-06-16},
url = {https://euf-methodology-hub.netlify.app/blog/2026-06-16-datascienceexercises/},
langid = {en}
}
---
title: "Practicing R with the DataScienceExercises Package"
description: "How to install and use the DataScienceExercises interactive exercise package to practice R with immediate feedback."
author: "Claudius Gräbner-Radkowitsch"
date: 2026-06-16
date-modified: 2026-06-16
image: ../../assets/images/blog-r.jpg
categories:
- R
- exercises
---
When learning a programming language, applying new concepts regularly is essential. Without regular practice it is hard to remember — and to find out what you have not yet understood well enough.
The `DataScienceExercises` package provides a set of interactive exercises for core R topics. Each exercise runs in your browser and gives immediate feedback on your answers. This post explains how to install the package and run exercises.
## Installation
The exercises use three packages: `learnr`, `gradethis`, and `DataScienceExercises`. All three are installed from GitHub, so you first need the `remotes` package:
```{r, eval=FALSE}
install.packages("remotes")
```
Then install the exercise packages:
```{r, eval=FALSE}
remotes::install_github(
repo = c(
"rstudio/learnr",
"rstudio/gradethis",
"graebnerc/DataScienceExercises"
),
upgrade = "always"
)
```
## Keeping the package up to date
The exercises are updated and extended over time. Before starting a practice session, run:
```{r, eval=FALSE}
remotes::install_github(
repo = "graebnerc/DataScienceExercises",
upgrade = "always"
)
```
An internet connection is only needed to update — the exercises themselves run offline once installed.
## Running an exercise
Resource pages on this hub that have associated exercises list the name of the exercise set. To launch one, pass that name to `learnr::run_tutorial()`. For example, to run the `Basics` set:
```{r, eval=FALSE}
learnr::run_tutorial(
name = "Basics",
package = "DataScienceExercises",
shiny_args = list("launch.browser" = TRUE)
)
```
Replace `"Basics"` with the name of whichever exercise set you want to practice.
## Reporting bugs or suggestions
If you find a mistake or have an idea for a new exercise, use the [issue tracker](https://github.com/graebnerc/DataScienceExercises/issues) on GitHub.
---
*Header image: photo by [Daniil Komov](https://unsplash.com/photos/laptop-screen-displaying-code-with-coffee-mug-nwfWXz-JSWA) on [Unsplash](https://unsplash.com/).*