Skip to content

Commit

Permalink
docs(r): add more notes on dependency management options
Browse files Browse the repository at this point in the history
  • Loading branch information
amyheather committed Jul 15, 2024
1 parent 1c5c62a commit 8b4b1d0
Showing 1 changed file with 64 additions and 1 deletion.
65 changes: 64 additions & 1 deletion r/environments.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,67 @@
# R environments
# Dependency management in R

CRAN won't let you use old versions of packages.

People like R because they can just use one R environment and everything works in that latest environment. General recommendation is just to use the latest stuff

"A big reason R doesn't have as rich an ecosystem for package installation tools (as compared to other languages) is because CRAN's design alleviates many of the challenges traditionally faced in package installation. As an example, CRAN checks new package updates to ensure they work with their upstream reverse dependencies. If updates fail to pass these "revdep checks", the package author must shoulder the burden of getting those reverse dependencies in line. Overall, this ensures that users going to install.packages get a set of packages that work together. Other languages push more of this work onto the person (and client) installing the package. However, as the R package ecosystem has grown, and people have developed more mission-critical workflows that require reproducibility, we have seen an uptick in the need for package management (as opposed to installation) tools." [[source]](https://forum.posit.co/t/what-is-the-current-state-of-r-package-mangers-in-2019/25143/2)

Binary packages, pre-compiled, etc. etc.

[CRAN Task View Initiative](https://cran.r-project.org/web/views/ReproducibleResearch.html) suggests checkpoint, containerit, dateback, groundhog, liftr, miniCRAN, packrat, rang, renv, Require, switchr.

* box
* capsule
* checkpoint
* 874 monthly downloads, last published 28 January 2022, [[source]](https://www.rdocumentation.org/packages/checkpoint/versions/1.0.2)
* can't use packages hosted elsewhere
* depends on maintenance of mRAN (which is now dead)
* conda
* containerit: Automatically generate Dockerfile from current R session
* Requires `R (>= 3.5.0)` [[source]](https://github.com/o2r-project/containerit/)
* Last updated 20 August 2019 [[source]](https://github.com/o2r-project/containerit)
* "Uses the posit.packagemanager.co servers hosted by Posit" [[source]](https://www.rdocumentation.org/packages/Require/versions/0.3.1)
* dateback
* Developed after MRAN closed, "miniCRAN package would be a better choice if you want to archive the current packages and will use them in the future. dateback will be helpful if you haven't archived packages in advance"
* Suggests Posit Package Manager for Windows and Mac users
* deps
* docker
* Needs root access
* groundhog
* From v3.0.0, relies on GRAN instead of MRAN
* 1071 monthly downloads, last published 3 February 2024, [[source]](https://www.rdocumentation.org/packages/groundhog/versions/3.2.0)
* jetpak
* liftr
* 237 monthly downloads, last published 19 June 2019, [[source]](https://www.rdocumentation.org/packages/liftr/versions/0.9.2)
* miniCRAN
* 1557 monhtly downloads, last published 28 March 2024, [[source]](https://www.rdocumentation.org/packages/miniCRAN/versions/0.3.0)
* packrat
* `packrat has been soft-deprecated and is now supseded by renv` [[source]](https://www.rdocumentation.org/packages/packrat/versions/0.9.2)
* pak
* "focuses on fast installations of current versions of packages on CRAN-like packages and GitHub.com and other similar code-sharing pages. This works well if the objective is to keep current. It is fast." [[source]](https://www.rdocumentation.org/packages/Require/versions/0.3.1)
* pkgr
* Posit Public Package Manager
* Posit has a free service (Posit Public Package Manager (P3M)) and a paid service (Posit Package Manager (PPM))
* You can set to install from Posit Package Manager instead of CRAN
* "Posit Public Package Manager is a free, hosted instance of Posit Package Manager." [[source]](https://docs.posit.co/rspm/admin/)
* You might see this referred to previously as RStudio's Package Manager (which now redirects to Posit)
* rang: Resolve the dependency graph of R packages at a specific time point in order to reconstruct the R computational environment.
* 180 monthly downloads, last published 8 October 2023, [[source]](https://www.rdocumentation.org/packages/rang/versions/0.3.0)
* rbundler
* remotes
* renv
* 455,641 monthly downloads, last published 11 April 2024, [[source]](https://www.rdocumentation.org/packages/renv/versions/1.0.7)
* As in their [old package documentation](https://www.rdocumentation.org/packages/renv/versions/0.3.0-40), renv aims to "be a robust, stable replacement for pakrat"
* Require
* 1936 monthly downloads, last published 22 May 2024, [[source]](https://www.rdocumentation.org/packages/Require/versions/0.3.1)
* rig
* rocker
* Pre-configured images
* roo
* r_portable
* switchr
* 464 monthly downloads, last published 21 March 2023, [[source]](https://www.rdocumentation.org/packages/switchr/versions/0.14.8)
* versions

## How to set-up renv for reproducible research

Expand Down

0 comments on commit 8b4b1d0

Please sign in to comment.