Skip to content


Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Launch RStudio Cloud Launch RStudio Binder superseded lifecycle

Consider targets

The targets R package is the long-term successor of drake, and it is more robust and easier to use. Please visit for full context and advice on transitioning. A short course on targets is available at

The drake short course

learndrake is a free online short course on the drake R package. With guided web-based hands-on exercises, you will gradually build up a drake-powered machine learning project and practice the fundamentals of drake. If you run into trouble or have questions along the way, please post an issue at to ask for help.

How to take the course

  1. Read the intro slides at and watch the video recording at
  2. Sign up for a free RStudio Cloud account at
  3. Log into the public RStudio Cloud workspace at You are now running an instance of RStudio Server with everything you need.
  4. In the “Files” pane of the IDE, locate the numbered folders with *.Rmd notebooks inside. Work through the notebooks in order.
Topic Notebook
Custom functions 1-functions/1-functions.Rmd
drake plans 2-plans/2-plans.Rmd
Changing workflows 3-changes/3-changes.Rmd
Static branching 4-static/4-static.Rmd
Dynamic branching 5-dynamic/5-dynamic.Rmd
Files and R Markdown 6-files/6-files.Rmd

Notebooks 3-changes/3-changes.Rmd and 4-static/4-static.Rmd rely on the following Shiny apps.

App Notebook 3-changes/3-changes.Rmd 4-static/4-static.Rmd 4-static/4-static.Rmd

The learndrake package

The learndrake R package contains the materials of the short course. It helps students take the workshop locally if they so choose, and it helps educators and administrators host the workshop from alternative platforms.


You can install learndrake from GitHub.


To run the exercises locally, you will also need TensorFlow and Keras.

# Check if the installation succeeded.

If you are using RStudio version 1.2.5003 and encounter this fatal error, consider downgrading TensorFlow to version 1.13.1. Note: install_keras() silently tries to upgrade TensorFlow to version >= 2, so you will need to run it with tensorflow = "1.13.1.


The functions in learndrake deploy and serve the course materials.

Function Purpose
save_notebooks() Save the *.Rmd notebooks to your computer.
view_slides() Open the intro slides in a web browser.
save_slides() Save the intro slides to your computer.
launch_app() Launch a supporting Shiny app.
save_app() Save the code files of a supporting Shiny app.

Accompanying resources

This short course focuses mostly on drake’s mental model and core concepts.

  • How to break up a project into functions.
  • How to think about and create drake plans.
  • How drake decides what is up to date and what is outdated.

The following resources cover important topics that did not make it into the syllabus.

In practice

  • Miles McBain’s excellent blog post explains the motivating factors and practical issues {drake} addresses for most projects, how to set up a project as quickly and painlessly as possible, and how to overcome common obstacles.
  • Miles’ dflow package generates the file structure for a boilerplate drake project. It is a more thorough alternative to drake::use_drake().
  • drake is heavily function-oriented by design, and Miles’ fnmate package automatically generates boilerplate code and docstrings for functions you mention in drake plans.

High-performance computing


Thanks to For
Edgar Ruiz Uniting drake and keras at and providing valuable advice on the construction of the course.
Matt Dancho Publishing the original blog post with the course’s underlying case study.
Eric Nantz Reviewing the materials and providing feedback.