renv for CRAN packages

Our team has gotten very used to using renv for managing our projects and leans on it's assurance that environments remain consistent between developers. Recently I was told that for one of our CRAN packages it is frowned upon to use renv, but couldn't find any supporting documentation about this.

TL;DR - Should you avoid activating renv for a CRAN package?

The R Packages book; suggests its use in certain cases.

The need to specify the exact versions of packages, rather than minimum versions, comes up more often in the development of non-package projects. The renv package provides a way to do this, by implementing project-specific environments (package libraries). renv is a reboot of an earlier package called packrat. If you want to freeze the dependencies of a project at exact versions, use renv instead of (or possibly in addition to) a DESCRIPTION file.:leftwards_arrow_with_hook:

At least some of the CRAN policies are here :

1 Like

renv can be useful for package development -- for example, because you want to develop and test that package against the development versions of other packages, without needing to install those dev. packages globally.

However, if you intend to submit that package to CRAN, you'll need to remove the associated renv infrastructure before submission. There's a bit of discussion around this at Package development • renv -- please let me know if there's additional detail that we could provide.

1 Like

Awesome, thank you for the response Kevin! Think we're going to have to deactivate some envs then, currently have one package on CRAN already that is activated with renv.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.