trackdown icon indicating copy to clipboard operation
trackdown copied to clipboard

why use renv for this project?

Open maelle opened this issue 2 years ago • 3 comments

out of curiosity :slightly_smiling_face:

maelle avatar Jan 05 '23 12:01 maelle

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?

ClaudioZandonella avatar Jan 08 '23 18:01 ClaudioZandonella

: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?

maelle avatar Jan 09 '23 07:01 maelle

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)

maelle avatar Jan 16 '23 13:01 maelle