Skip to content
Example workflows for the drake R package
Branch: master
Clone or download
Latest commit 580789b Jun 21, 2019

travis Launch Rstudio Binder

drake examples

This repository is part of a community effort to collect, curate, and share publicly available examples of data analysis projects powered by the drake R package. Each folder is its own example with a self-sufficient set of code and data files.

Run in a browser

Click this badge to open the examples in RStudio through your browser: Launch Rstudio Binder

Run locally

You can download example files and run them locally with drake itself.

# Install and load drake.
# List the available examples.
# Get an example
list.files() # See the new 'main' folder


Please read the top-level and for rules and instructions.

Introductory examples

  • customer-churn-simple: based on an RStudio Solutions Engineering example of how to use Keras with R. The motivation comes from a blog post by Matt Dancho, and the code is based on a notebook by Edgar Ruiz. If it takes too long to store your deep learning models this kind of workflow, try customer-churn-fast.
  • customer-churn-fast: similar to customer-churn-simple, but with more nuance to mitigate a potential serialization bottleneck.
  • main: drake's main bare-bones introductory example, written by Kirill Müller.
  • gsp: A concrete example using real econometrics data. It explores the relationships between gross state product and other quantities, and it shows off drake's ability to generate lots of reproducibly-tracked tasks with ease.
  • packages: A concrete example using data on R package downloads. It demonstrates how drake can refresh a project based on new incoming data without restarting everything from scratch.
  • mtcars: An old legacy example with the mtcars dataset. Use load_mtcars_example() to set up the project in your workspace.

High-performance computing examples

  • mlr-slurm: an example machine learning workflow rigged to deploy to a SLURM cluster.
  • Docker-psock: demonstrates how to deploy targets to a Docker container using a specialized PSOCK cluster.
  • sge: uses drake's high-performance computing functionality to send work to a Grid Engine cluster.
  • slurm: similar to sge, but for SLURM.
  • torque: similar to sge, but for TORQUE.

Development examples

  • overhead: an example explicitly designed to maximize strain on drake's internals. The purpose is to support profiling studies to speed up drake.

Demonstrations of specific features

  • code_to_plan: a demonstration of drake's code_to_plan() function, which can turn ordinary quoted code, R scripts, and knitr / R Markdown reports into drake workflow plan data frames.

Real-world examples outside this repo

The official rOpenSci use cases and associated discussion threads describe applications of drake in action. Here are some more real-world sightings of drake in the wild.

You can’t perform that action at this time.