Practicing R with the DataScienceExercises Package

R
exercises
How to install and use the DataScienceExercises interactive exercise package to practice R with immediate feedback.
Author

Claudius Gräbner-Radkowitsch

Published

June 16, 2026

Modified

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.

1 Installation

The exercises use three packages: learnr, gradethis, and DataScienceExercises. All three are installed from GitHub, so you first need the remotes package:

Code
install.packages("remotes")

Then install the exercise packages:

Code
remotes::install_github(
  repo = c(
    "rstudio/learnr",
    "rstudio/gradethis",
    "graebnerc/DataScienceExercises"
  ),
  upgrade = "always"
)

2 Keeping the package up to date

The exercises are updated and extended over time. Before starting a practice session, run:

Code
remotes::install_github(
  repo = "graebnerc/DataScienceExercises",
  upgrade = "always"
)

An internet connection is only needed to update — the exercises themselves run offline once installed.

3 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:

Code
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.

4 Reporting bugs or suggestions

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.

Citation

BibTeX citation:
@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}
}
For attribution, please cite this work as:
Gräbner-Radkowitsch, Claudius. 2026. “Method and Inquiry.” June 16. https://euf-methodology-hub.netlify.app/blog/2026-06-16-datascienceexercises/.