Skip to contents

By default returns the pre-built .repro_docker_default_image regardless of what R version the paper declared – fast (most dependencies are already installed), but runs against whatever R version that image was built with, not necessarily the paper's own. When use_declared_version is TRUE, picks the rocker/r-ver tag matching the R version .code_version_pin_check() found declared in the paper's repository (an renv.lock's R.Version, or a sessionInfo() dump's first line — see that function) instead — a bare image with nothing pre-installed, so every dependency is installed from scratch, but it matches the paper's own declared environment. Falls back to bare rocker/r-ver:latest (not the pre-built image) when use_declared_version = TRUE but nothing was declared, since there is no version to match in that case either way, and silently reusing the pre-built image would defeat the point of asking for version-matching in the first place.

Usage

.repro_docker_image_for(
  r_versions = character(0),
  use_declared_version = FALSE
)

Arguments

r_versions

character vector of declared R version strings (e.g. from .code_version_pin_check()$r_versions), possibly empty

use_declared_version

if TRUE, use r_versions (see above) instead of the pre-built image. Default FALSE.

Value

a single image reference, e.g. "ghcr.io/scienceverse/metacheck_r_large:latest", "rocker/r-ver:4.3.1", or "rocker/r-ver:latest"