Use renv for package management
Context
This initiates the use of renv in this project. renv is a package manager in R that ensures that package versions used by a project are static and consistent across collaborators. This should give us a much greater sense of reproducibility and should help ensure that this pipeline "just works" across users and across time.
Summary of changes
I did the work of updating packages and initiating the use of renv in the project. This creates 3 files/directories
-
renv/
- the project library. This is where packages will be installed. More precicely, this will contain shortcuts/pointers to installed packages that point to a global package repository elsewhere on your machine, which holds all the packages used by renv across all your projects. -
renv.lock
- the lockfile. This is similar toenvironment.yaml
in Python/conda. It contains metadata for all package dependencies for the project. This is what is used to ensure all projects have the same package versions. -
.Rprofile
- an project-specific R profile. This file runs every time you start R. In this case, it ensures that renv is activated for the project and it helps it run behind the scenes.
Expected results
This should not substantially change your expirience using the pipeline except for the first time using it. It should not affect the results of the pipeline (at lest, it shouldn't affect them dramatically), but there isn't a good way to predict it because we have probably been using different versions of different packages. It is likely that after running tar_make()
the pipeline will re-run in its entirety although I am not sure. When planning for testing, assume that it will.
Requested review
- If not already, get familiar with renv by at least reading Introduction to renv.
- Open the project and do as instructed. I think it will ask you to run
renv::restore()
. Please keep track of any setup steps you have to do and add them toREADME.md
. - Run
targets::tar_make()
to re-build the entire pipeline to ensure it is up to date. Let me know if anything unexpected happens. - Make sure
README.md
is accurate and makes sense.