There is a Bioconductor package BiocFileCache that creates a persistent on-disk cache of files that the user can add, update, and retrieve. I have not been able to find a CRAN alternative. Am I not searching properly? If there really isn't one, why not? Is it really a Bioconductor-specific problem?
1 Like
See some here:
https://r-pkg.org/search.html?q=cache+files
Or from R:
❯ pkgsearch::pkg_search("cache files")
- "cache files" ------------------------------ 1669 packages in 0.148 seconds -
# package version by @ title
1 100 hoardr 0.5.5 Tamás Stirling 4M Manage Cached Files
2 58 dlr 1.0.1 Jon Harmon 4y Download and Cache File...
3 15 fscache 1.0.5 Pierrick Roger 1y File System Cache
4 11 hfhub 0.1.1 Daniel Falbel 2y Hugging Face Hub Interface
5 8 zendown 0.1.0 Raphael Saldanha 1y Access Files from 'Zeno...
6 8 pak 0.8.0.2 Gábor Csárdi 29d Another Approach to Pac...
7 8 R.cache 0.17.0 Henrik Bengtsson 5d Fast and Light-Weight C...
8 6 repmis 0.5 Christopher Gandrud 9y Miscellaneous Tools for...
9 5 reproducible 2.1.2 Eliot J B McIntire 5M Enhance Reproducibility...
10 4 deSolve 1.40 Thomas Petzoldt 1y Solvers for Initial Val...
2 Likes
Those are some interesting options. Only dlr seems to be focused on managing downloads, but it hasn't been updated in 4 years.
Through these, I discovered rappdirs, which seems like the most basic solution and is imported by some very popular packages like reticulate and usethis. Although it looks like you should be switching from rappdirs::user_cache_dir
to tools::R_user_dir
since R 4.0.