renv: how should we configure renv when the R common library is not writable by users?

We would like to use renv for package management in a small team of people working collaboratively on a computing cluster. Since R was installed by the system administrator, the R common library only contains ~20 packages and is not writable by users (i.e. we can't install additional packages here). The knock-on effect seems to be that the renv cache is not very effective at reducing disk-space requirements because it only links to the ~20 packages pre-installed by the admin. Every other package ends up being re-installed in each of the users local renv libraries for every project they work on. Is there a more time and disk-space efficient way to use renv in this situation? Could we make the renv cache work with USER libraries (R_LIBS_USER), which would reduce the duplication across projects? Or, change the location of the R common library to somewhere that is writable by all users?

We might be able to work around these problems using a local installation of R, but I am just interested to know whether renv is designed to be configurable for the situation described above (or if I have misunderstood something about how it is supposed to work).

Thanks!

Does your computing cluster have some global storage space available? If so, you should be able to configure renv to place its package cache there, using something like:

RENV_PATHS_CACHE = /path/to/shared/storage/renv/cache

This could be placed in an appropriate startup .Renviron file -- see ?Startup in R for more details. See also Installing packages • renv, which discusses the use of the renv cache in a bit more detail.

This topic was automatically closed 21 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.