The global cache is great, but I often find myself wanting to start from scratch for one reason or another, particularly confirming reproducibility. purge() is limited in three main ways for this
purge() only accepts one package at a time. I can get around this with lapply() + dependencies()
- Usually, when I want this approach, it is precisely this workflow: purge all packages in the cache that this project uses. Again, I can combine it with
dependencies() to meet that need, but ideally this would be streamlined with a new argument like purge_project
purge() does not remove symlinks. I think that could make sense as a default but I would like it if we could optionally remove the symlinks in the project, too. This would practically be limited to the project's symlinks and would still result in broken symlinks from any other project that used those packages from the cache.
Ideally, I would also be able to completely purge the entire cache (regardless of package and R version, project, etc) with something like purge_all.
Currently you can do this by just deleting the folder
# Retrieve the root cache path
cache_path <- renv::paths$root()
# Delete the entire cache directory recursively
unlink(cache_path, recursive = TRUE)
but again, it would be nice to streamline this for reproducibility checks or other issues.
The global cache is great, but I often find myself wanting to start from scratch for one reason or another, particularly confirming reproducibility.
purge()is limited in three main ways for thispurge()only accepts one package at a time. I can get around this withlapply()+dependencies()dependencies()to meet that need, but ideally this would be streamlined with a new argument likepurge_projectpurge()does not remove symlinks. I think that could make sense as a default but I would like it if we could optionally remove the symlinks in the project, too. This would practically be limited to the project's symlinks and would still result in broken symlinks from any other project that used those packages from the cache.Ideally, I would also be able to completely purge the entire cache (regardless of package and R version, project, etc) with something like
purge_all.Currently you can do this by just deleting the folder
but again, it would be nice to streamline this for reproducibility checks or other issues.