Thank you for the tip. I had heard of renv but somehow couldn't remember the name.
As for it's suitability, it doens't seem to be an improvment over packrat, at least for my use case. After installing it, devtools::install_github("rstudio/renv"), I ran renv::migrate() as suggested, copied the lock file to another computer, and ran renv::restore() and got the following error:
* Querying repositories for available source packages ... Done!
Retrieving 'https://bioconductor.org/packages/3.8/bioc/src/contrib/Archive/AnnotationDbi/AnnotationDbi_1.46.0.tar.gz' ...
curl: (22) The requested URL returned error: 404 Not Found
curl: (22) The requested URL returned error: 404 Not Found
Retrieving 'https://bioconductor.org/packages/3.8/data/annotation/src/contrib/Archive/AnnotationDbi/AnnotationDbi_1.46.0.tar.gz' ...
curl: (22) The requested URL returned error: 404 Not Found
curl: (22) The requested URL returned error: 404 Not Found
Retrieving 'https://bioconductor.org/packages/3.8/data/experiment/src/contrib/Archive/AnnotationDbi/AnnotationDbi_1.46.0.tar.gz' ...
curl: (22) The requested URL returned error: 404 Not Found
curl: (22) The requested URL returned error: 404 Not Found
Retrieving 'https://bioconductor.org/packages/3.8/workflows/src/contrib/Archive/AnnotationDbi/AnnotationDbi_1.46.0.tar.gz' ...
curl: (22) The requested URL returned error: 404 Not Found
curl: (22) The requested URL returned error: 404 Not Found
Retrieving 'https://cran.rstudio.com/src/contrib/Archive/AnnotationDbi/AnnotationDbi_1.46.0.tar.gz' ...
curl: (22) The requested URL returned error: 404 Not Found
curl: (22) The requested URL returned error: 404 Not Found
Retrieving 'https://cran.rstudio.com//src/contrib/Archive/AnnotationDbi/AnnotationDbi_1.46.0.tar.gz' ...
curl: (22) The requested URL returned error: 404 Not Found
curl: (22) The requested URL returned error: 404 Not Found
Error: failed to retrieve package 'AnnotationDbi' from CRAN
Traceback (most recent calls first):
9: stop(sprintf(fmt, ...), call. = call.)
8: stopf("failed to retrieve package '%s' from CRAN", record$Package)
7: renv_retrieve_cran(record)
6: renv_retrieve_bioconductor(record)
5: renv_retrieve_impl(package)
4: handler(package, renv_retrieve_impl(package))
3: renv_retrieve(packages)
2: renv_restore_run_actions(project, diff, current, lockfile)
1: renv::restore()
Again the issue is mainly with Biocondutor packages. Reading the GH issues, it should have gracefully failed the installation and moved on to the next package, but that was not the case. No idea what it was looking for the package sources on that location either.
Cheers.