Learn R Programming

renv (version 0.15.3)

embed: Embed a Lockfile

Description

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.

Usage

embed(path = NULL, ..., lockfile = NULL, project = NULL)

Arguments

path

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.

lockfile

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.

project

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.

Details

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.