Use embed()
to embed a compact representation of an renv
lockfile
directly within a file, using use()
to automatically provision an
R library when that script is run.
embed(path = NULL, ..., lockfile = NULL, project = NULL)
The path to an R or R Markdown script.
Unused arguments, reserved for future expansion. If any arguments
are matched to ...
, renv
will signal an error.
The path to an renv
lockfile. When NULL
(the default), the project
lockfile will be read (if any); otherwise, a new lockfile will be generated
from the current library paths.
The project directory. If NULL
, then the active project will
be used. If no project is currently active, then the current working
directory is used instead.
Using embed()
is useful if you'd like to be able to share "reproducible"
R scripts -- when these scripts are sourced, the generated call to
renv::use()
will ensure that an R library with the requested packages
is automatically provisioned.