2016-08-10

Some data!

Tidy workflow

  • screen-cap'd from Hadley Wickham's useR 2016 talk on the Tidyverse

6 months later…

  • Sharing code with colleague
    • "Clone my repo, it's all in there"
    • Packages no longer on CRAN
    • Packages have been updated: code breaks/behavior changes
  • Problematic if you need to update results or reproduce work

What packrat solves

AKA why you should use it

  • Everything that happens inside this box occurs within an environment

What is it?

  • A package dependency management system for R
    • Influenced by bundler for Ruby
    • Developed by RStudio
      • designed to work well with projects (.Rproj files)
    • Ensures projects maintain reproducibility long-term
  • Need to be able to build packages in order to use

What is it?

Basic concepts

  • Private Package Library
    • local package tar balls (source code)
  • Snapshots
    • current state of a project
  • Restoring
    • rebuilding a project's environment based on a snapshot

Updated workflow

  • A new folder added: packrat/
    • add and remove packages normally, as you would in any other setting

Key changes

  • When you start an R session in a directory associated w/ a packrat project:
    • R only sees the packages installed in your private package library
    • installations and removal of packages will only affect the private package library

Getting started

  • Quick tutorial on setting up a project

Wrap-up