MRG recommendation is to manage R Packages at a project-by-project level. In particular, keeping each project isolated from one another, such that the packages used and the package versions that are used are independent of what is on the workflow.
So, if you use a newer workflow version in the future, you don't have to worry about your script all of a sudden not working. Likewise, you can have different projects from different periods of time that can cohabitate healthily.
With R, in a given directory or project, you can only have one version of a package, so you can not have recursive, multiple versions of a package depending on what needs it, you can only have one. So, MRG prefers to manage at a project by project level.
The way MRG does this is two-fold:
- An R package called renv. Has two key functions:
- It's an R package dependency manager, although MRG does not use for its dependency management capabilities (we have a separate tool, pkgr for that, which will be mentioned later)
- It forces isolation on a project by project basis.