Support

Comparing RStudio Package Manager and Packrat

Follow

RStudio Package Manager and RStudio's packrat package are both tools designed to help organizations implement a package management strategy. These tools can be used independently or they can be used together.

Example Strategies

Packrat for Reproducibility, Package Manager for Access

Packrat can track what packages a uses, while RStudio Package Manager makes CRAN and internal packages accessible in an offline environment. Package Manager correctly handles archiving packages so they can be used by packrat.

RStudio Package Manager's checkpoints for time travel

A user who is uncomfortable with environment management can use Package Manager's checkpoints to travel back in time. They might use packrat, or other tools, to isolate different project libraries while they time travel.

RStudio Package Manager's curated source for validated projects

A validated project can use a curated Package Manager source to ensure only approved packages are used by a team.

Use within docker

A docker based infrastructure can use Package Manager's checkpoints to guarantee a reproducible base environment. Packrat can be used within a container session to explicitly capture which packages from the base environment were used.

Comparison of tools

 

Packrat

R package

Checkpoints

RStudio Package Manager

Curated Source

RStudio Package Manager

Where is it used? R client Server  Server
Who is responsible? R user managing the project Checkpoints are automatic   Administrators work with R users
Who benefits? R user Everyone Teams
How does it work? Users "snapshot" their project's dependencies into a file; and then the environment can be "restored" from the snapshot. The repo option is set to a checkpoint URL, and packages from a frozen point in time can be installed.  Administrators create a set of locked down packages that everyone uses.
When is it used? Snapshots must be done proactively. Checkpoints can be used proactively or passively.
If a project stops working, you can go back to a previous point in time when it did work. 
Curated sources are actively managed, with a dry-run preview before an addition or update.

Other Considerations

While both RStudio Package Manager and packrat provide tools to help with reproducibility, it is important to understand that RStudio Package Manager also provides solutions to a host of other problems:

  • Accessing packages in an offline environment
  • Centralizing and auditing package use
  • Sharing internal packages
  • Layering packages from CRAN, Git(Hub), and local sources
  • System-level dependencies [future enhancement]
  • Package binaries on Linux [future enhancement]

Comments