0

I started using renv with R 4.2.1. I upgraded to R 4.2.2 and I could not use some packages (e.g. markdown). I followed this guide to update the cache and now I have two folders:

~/Library/Caches/org.R-project.R/R/renv/cache/v5/R-4.2/x86_64-apple-darwin22.1.0
~/Library/Caches/org.R-project.R/R/renv/cache/v5/R-4.2/x86_64-apple-darwin21.6.0

Both appear to be duplicates. How can I clean this up? My goal is to have only one. Can I just rm -rf the folder?

Hahnemann
  • 4,378
  • 6
  • 40
  • 64

1 Answers1

0

You can, assuming you don't plan on using R 4.2.1 anymore. The documentation at https://rstudio.github.io/renv/articles/renv.html#cache should be helpful.

The main questions to ask, when determining if it's safe to remove an renv cache folder is:

  1. Will I ever use the verison of R associated with this cache anymore?
  2. If required, will I be able to re-install the previously-cached packages?

Note that option (2) becomes surprisingly harder as versions of R become older -- e.g. package binaries may no longer be available, or packages with compiled code may no longer compile, and so on. See https://rstudio.github.io/renv/articles/renv.html#caveats for a related discussion.

Kevin Ushey
  • 20,530
  • 5
  • 56
  • 88