Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

find_cran_date.py - Find CRAN snapshot date for R packages

Description

Determines the minimum CRAN snapshot date for a set of pinned R packages. Given a file specifying R package versions (R script, renv.lock, DESCRIPTION, or CSV), this tool queries the crandb API to find when all specified package versions were simultaneously available on CRAN, then reports matching Docker images and Posit Package Manager snapshot URLs.

Usage

python tools/find_cran_date.py <input_file> [--output <path>] [--verbose]

Arguments

Examples

# Analyze R setup script
python tools/find_cran_date.py 209465/Code/0_setup.R

# Save results to file
python tools/find_cran_date.py renv.lock --output generated/notes-for-r.md

# Verbose mode
python tools/find_cran_date.py packages.csv --verbose

Output

The tool reports:

  1. Minimum CRAN snapshot date when all package versions existed

  2. Matching rocker/verse Docker container image

  3. Posit Package Manager snapshot URL for reproducible installations

  4. Compatible R version(s)

Requirements

Use Cases

Technical Details

See Also