Skip to content
An interactive workshop on drake
HTML JavaScript CSS R Other
Branch: master
Clone or download
Latest commit 1384bf1 Feb 23, 2020


Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Public release Jun 11, 2019
inst Minor edit Feb 23, 2020
man Change app name Feb 9, 2020
tests Update tests Feb 10, 2020
.Rbuildignore Ignore rsconnect Feb 11, 2020
.gitignore Ignore rsconnect Feb 11, 2020
.lintr Use tibble printing Feb 10, 2020
.travis.yml Re-automate deployment of slides Feb 14, 2020 Public release Jun 11, 2019 Edit meta file Jul 3, 2019
DESCRIPTION Rm clustermq and zmq deps Feb 10, 2020
LICENSE Public release Jun 11, 2019
NAMESPACE Gradually build up plan in slides Feb 3, 2020 Update news Feb 10, 2020
README.Rmd Update README Feb 14, 2020 Update README Feb 14, 2020 Suppress binder updates Feb 22, 2020
learndrake.Rproj Update slides Sep 17, 2019
shinyapps.R Change app name Feb 9, 2020

Launch RStudio Cloud Launch RStudio Binder Travis build status Codecov test coverage

Reproducible workflows at scale with drake

Ambitious workflows in R, such as machine learning analyses, can be difficult to manage. A single round of computation can take several hours to complete, and routine updates to the code and data tend to invalidate hard-earned results. You can enhance the maintainability, hygiene, speed, scale, and reproducibility of such projects with the drake R package. drake resolves the dependency structure of your analysis pipeline, skips tasks that are already up to date, executes the rest with optional distributed computing, and organizes the output so you rarely have to think about data files. This workshop will teach you how to create and maintain machine learning projects with drake-powered automation.


To obtain the workshop materials, install the learndrake package, 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.


RStudio Cloud (pre-built)

  1. Sign up for RStudio Cloud.
  2. Navigate to to open a new copy of the workshop.
  3. Optional: save a permanent copy so you can come back to it later. Look for the red “temporary copy” text at the top and click the “save a permanent copy” option next to it.

RStudio Cloud (custom)

This approach takes a bit longer to set up than the pre-built project.

  1. Sign up for RStudio Cloud.
  2. Create a fresh new project.
  3. Run this setup script to install the dependencies and download the materials.


Just click this badge: Launch RStudio Binder. Your browser will open the materials in a free RStudio Server instance.

  • Advantage: no need to sign up for RStudio Cloud.
  • Disadvantage: long load times and quick timeouts.


The functions in learndrake help navigate and deploy the workshop materials. If you installed the package and dependencies as above, you can take the workshop locally without an internet connection. Start with the introductory slides, then move on to the notebooks. Launch apps along the way as directed.

Function Purpose
launch_app() Launch a Shiny app that accompanies a tutorial.
save_app() Save the app files so you can deploy to or Shiny Server.
save_notebooks() Save the tutorials to your computer: R notebooks and supporting files.
save_slides() Save the introductory slides to your computer.
view_slides() Open the introductory slides in a web browser.

Introductory presentation

The workshop begins with an introductory presentation on drake. You can find a video recording here. Alternatively, you can view the slides at or open them yourself in a browser with view_slides().



After the introductory presentation, students work through a sequence of R notebooks in order. Use save_notebooks() to save the notebooks and supporting files to your computer.

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.Rmd and 4-static.Rmd come with supporting Shiny apps to conduct the learning exercises. Use launch_app() to run any of these apps locally.

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


Thanks to For
Edgar Ruiz Uniting drake and keras at and providing valuable advice on the construction of the workshop.
Matt Dancho Publishing the original blog post with the workshop’s underlying case study.
Eric Nantz Reviewing and providing feedback on this workshop.
You can’t perform that action at this time.