Friday, February 18, 2022

[SOLVED] Maintain different versions of R package for open source contribution

Issue

Packrat is often recommended as the virtual environment for R, but it doesn't fully meet my need of contributing to R open source. Packrat's "virtual environment" is stored directly in the project directory, requiring me to modify the .gitignore to ignore them when I make a pull request to the open source upstream.

In contrast, something like conda stores the virtual environment somewhere else, leaving no trace in the project codebase itself.

So how do R open source contributors deal manage dependencies during package development? Ideally the solution would work well with devtools and Rstudio.


Solution

  1. There is nothing wrong in having Packrat in .gitignore.

  2. You can use .git/info/exclude file thus avoiding touching the .gitignore.



Answered By - phd
Answer Checked By - David Goodson (WPSolving Volunteer)