I would like to address this situation.
I am using renv to capture the packages. At the same time, the only CRAN available repo is the one allowed by my company which is limited. To install package outside of the CRAN's company, I am providing the package as tarball and installing from source.
Then use the following code to provide source location in the lock file
library(renv) # Custom Package description package_name <- "<PACKAGE_NAME>" package_version <- "<PACKAGE_VERSION>" package_source <- paste0("renv/local/", package_name, "_", package_version, ".tar.gz") # Modifying lock file based on package description lockfile <- renv:::renv_lockfile_read("renv.lock") lockfile$Packages[[package_name]]$Package <- package_name lockfile$Packages[[package_name]]$Version <- package_version lockfile$Packages[[package_name]]$Source <- package_source renv:::renv_lockfile_write(lockfile, "renv.lock")
However, the workflow in my company is using a git hook doing a snapshot, thus erasing the local source info in the lock file.
My question is:
Is there a way for renv to snapshot automatically packages installed from source?