2

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.

Heisenberg
  • 8,386
  • 12
  • 53
  • 102

1 Answers1

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

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

phd
  • 82,685
  • 13
  • 120
  • 165
  • `.git/info/exclude` seems like the solution! On the point of having Packrat in `.gitignore`, isn't it a problem if the package maintainer doesn't use Packrat and thus doesn't want to include it? I can modify `.gitignore`, but the package maintainer wouldn't like the change. Or perhaps I'm missing something. – Heisenberg Aug 01 '18 at 17:04
  • 1
    That's a question of policy and communication. For example, I use `vim` and never used Emacs, and my `vim` is configured to not store backup files but I still have `*.bak` and `*~` in `.gitignore` files in different projects ([1](https://github.com/sqlobject/sqlobject/blob/6e17054a2ee004bcaeee7e915d31dd9270f7694c/.gitignore), [2](https://github.com/CheetahTemplate3/cheetah3/blob/24475a148b303da781ced12105f231e5c0579981/.gitignore)) because that helps other developers who have different configuration. – phd Aug 01 '18 at 17:18