Pinning R package versions -


how best pin package versions in r?

rejected strategy 1: pin cran source tar.gzs

  • doesn't work if want pin @ latest version since cran not put tip version in archive (duh)

rejected strategy 2: use devtools

  • don't want to, because takes ages compile , adds lots of stuff don't want use

rejected strategy 3: vendor

  • would rather avoid having copy source

to provide little bit more information on packrat, use purpose. website.

r package dependencies can frustrating. have ever had use trial-and-error figure out r packages need install make else’s code work–and been left packages globally installed forever, because you’re not sure whether need them? have ever updated package code in 1 of projects work, find updated package makes code in project stop working?

we built packrat solve these problems. use packrat make r projects more:

isolated: installing new or updated package 1 project won’t break other projects, , vice versa. that’s because packrat gives each project own private package library. portable: transport projects 1 computer another, across different platforms. packrat makes easy install packages project depends on. reproducible: packrat records exact package versions depend on, , ensures exact versions ones installed wherever go.

packrat stores version of packages use in packrat.lock file, , downloads version cran whenever packrat::restore(). lighter weight devtools, can still take time re-download of packages (depending on packages using).

if prefer store of sources in zip file, can use packrat::snapshot() pull down sources / update packrat.lock , packrat::bundle() "bundle" up. aim make projects / research reproducible , portable on time storing package versions , dependencies used on original design (along source code os dependency on binary avoided).

there more information on website linked to, , can see current activity on git repo. have encountered few cases work in less-than-ideal way (packages not on cran have issues @ times), git repo still seems pretty active issues/patches encouraging.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -