knitr::opts_chunk$set( collapse = TRUE, comment = "#>", eval = FALSE )
If your project depends on R packages not available in any external source, you can set up an ad-hoc local source to use during restore. This allows you to provide package tarballs that can be used to restore packages otherwise not available elsewhere.
The environment variable RENV_PATHS_LOCAL
can be used to customize where this
local source of packages should live. It should point to a directory containing
package binaries and sources, with a structure of the form:
${RENV_PATHS_LOCAL}/<package>/<package>_<version>.tar.gz
For example, if your project depended on a package skeleton [1.0.0]
, you could
place the tarball for this package at:
${RENV_PATHS_LOCAL}/skeleton/skeleton_1.0.0.tar.gz
Once this is done, renv
will consult this directory during future attempts to
restore packages installed from unknown sources.
If you want to see what directory is being used by renv
for local package
sources, you can execute:
renv:::renv_paths_local()
See ?paths
for more details.
You can also provide explicit source paths in the lockfile if desired. This is
most useful if you are building an renv
lockfile "by hand", or need to tweak
an existing lockfile to point at a separate package for installation. For example,
you could have a package record in renv.lock
of the form:
Package=skeleton Version=1.0.1 Source=/mnt/r/pkg/skeleton_1.0.1.tar.gz
The main requirement is that your source path exists, and the path has an extension
of either .tar.gz
, .tgz
(for macOS binaries) or .zip
(for Windows binaries).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.