trackdown
trackdown copied to clipboard
why use renv for this project?
out of curiosity :slightly_smiling_face:
Hi @maelle,
I use renv more out of habit than for any other specific reason. I use renv in all my projects to track package dependencies. Also when developing packages I like having the possibility to control all the dependencies installed.
You are right that renv is not commonly used when developing R-packages. Actually, in this case, renv may also be harmful as testing the package functions should not depend on a specific environment.
To avoid this problem, I run all tests on GitHub actions without using renv. In this way, the latest package versions are used [or at least this is my understanding].
Do you see any other inconveniences of using renv when developing R-packages? Or do you suggest other workflows?
:wave: @ClaudioZandonella!
As an external contributor, I must say I first deactivated renv before contributing. :sweat_smile: I can't remember which package I wanted to use was missing, maybe it was devtools? So it was just easier for me to use my local library.
To install all the dependencies needed for a package project, I run pak::pak()
which works well and is easy to remember.
If you keep using renv, as it is not common for package development maybe CONTRIBUTING.md
should mention it?
Another comment on the project setup. For renv and other things there is an .Rprofile
in this repository, which masks my user level .Rprofile
(that I use for loading {reprex}, {devtools}, {gert}).
Would you consider adding
if (file.exists('~/.Rprofile')) {
base::sys.source('~/.Rprofile', envir = environment())
}
to it so that both user-level and project-level Rprofiles are loaded? (a trick I got from https://bookdown.org/yihui/blogdown/global-options.html)