r-lib / remotes

Install R packages from GitHub, GitLab, Bitbucket, git, svn repositories, URLs
https://remotes.r-lib.org/
Other
331 stars 152 forks source link

Clearing cache of installed packages #589

Closed clbarnes closed 3 years ago

clbarnes commented 3 years ago

I'm trying to set up an R environment as part of a larger application in a docker container. A number of packages are installed using remotes::install_{github,version} and I was wondering whether it was possible to reduce the size of $R_LIBS_USER (which is now multiple gigabytes). Is there any distinction between the cloned repository/ downloaded tarball and the built R package, so that the repo (which often has an extensive git history, lots of static files as part of web docs etc.) could be removed and keep the docker image light?

I am already clearing temporary files (rm -rf /tmp/Rtmp*).

jimhester commented 3 years ago

Remotes doesn't store the downloaded repository, it downloads it to the R sessions temp directory and then installs the package from there. The only thing in R_LIBS_USER is the built package.

This sort of question is a better fit for https://community.rstudio.com. If you have further questions along this line do you mind asking them over there? (You might want to read https://www.tidyverse.org/help/ first to maximise your chances of getting a good answer)

clbarnes commented 3 years ago

Sure, thank you for your quick and informative response!