Skip to content

Commit

Permalink
Merge pull request #109 from ecohealthalliance/update/dependencies-renv
Browse files Browse the repository at this point in the history
updating dependency chapter
  • Loading branch information
collinschwantes authored Jan 9, 2024
2 parents d936488 + 3d20866 commit 33e188d
Show file tree
Hide file tree
Showing 2 changed files with 106 additions and 204 deletions.
26 changes: 11 additions & 15 deletions dependencies.Rmd
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
# Dependency Management {#dependencies}

*How do I make sure that all my software and configurations needed for a project
are portable?*
*How do I make sure that all my software and configurations needed for a projects are portable?*

- [Packrat](https://rstudio.github.io/packrat/) or
[checkpoint](https://CRAN.R-project.org/package=checkpoint) to fix R package
versions.
- [Docker](https://www.docker.com/) for everything

- [renv](https://rstudio.github.io/renv/articles/renv.html) captures package versions and sources as well as R version. `renv` also records python versions and virtual environments for projects that used both languages.
- The [capsule](https://github.com/MilesMcBain/capsule) package can be useful when you want version control/depedency management but not the full weight of `renv`. Sometimes, `renv` can be an impediment for smaller and highly collaborative projects, that is where capsule can be useful. Ultimately, capsule will allow to setup `renv` for a project when it gets to a stable state.

- [Docker](https://www.docker.com/) allows you to create virtual machines, meaning you can capture all system dependencies in addition to the dependencies captured in `renv`. It works for essentially any programming language and is extremely flexible.
- [UseR 2022 Docker workshop](https://github.com/rsangole/user2022-r-for-docker/tree/main)
- [A lesson in user Docker for an R
project](http://ropenscilabs.github.io/r-docker-tutorial/)
- Makefiles can automate a complex, multipart project. Here's [a lesson on
them from Software Carpentry](http://swcarpentry.github.io/make-novice/)
project](http://ropenscilabs.github.io/r-docker-tutorial/)
- Makefiles can automate a complex, multipart project. Here's [a lesson on them from Software Carpentry](http://swcarpentry.github.io/make-novice/)

- R packages can be a useful project output. We have some in-house R packages
to provide access to internal data and generate reports, and may be
developing more for external audiences. Hadley Wickham's [R Packages
Book](http://r-pkgs.had.co.nz/) provides guidance for these, and we expect
our packages to be up to [rOpenSci
standards](https://github.com/ropensci/onboarding).
- R packages can be a useful project output. We have some in-house R packages to provide access to internal data and generate reports, and may be developing more for external audiences. Hadley Wickham's [R Packages Book](http://r-pkgs.had.co.nz/) provides guidance for these, and we expect our packages to be up to [rOpenSci standards](https://github.com/ropensci/onboarding).

- R package installation can be especially tricky on Mac computers with [Apple Silicon](https://support.apple.com/en-us/HT211814). Below are some steps to get
package install set ups.
Expand Down Expand Up @@ -45,3 +40,4 @@ FLIBS = -L/opt/homebrew/Cellar/gcc/13.2.0/lib/gcc/13
configure.args = "--with-udunits2-lib=/opt/homebrew/Cellar/udunits/2.2.28/lib --with-udunits2-include=/opt/homebrew/Cellar/udunits/2.2.28/include")`


Historically some projects used [Packrat](https://rstudio.github.io/packrat/) or [checkpoint](https://CRAN.R-project.org/package=checkpoint) to fix R package versions. These systems have been superceded by `renv`.
Loading

0 comments on commit 33e188d

Please sign in to comment.