Skip to contents

Every package ever published to CRAN keeps its full version history under the CRAN Archive (https://cran.r-project.org/src/contrib/Archive/<pkg>/), even after the live repository stops serving it. This lists that directory, takes the most recent version by file modification time (the directory listing carries no other reliable ordering), and installs the source tarball directly — the one fallback worth trying automatically when a CRAN-source dependency is not on live CRAN, since it needs no extra service or paper-specific date, just the package name.

Usage

.repro_cran_archive_install(pkg, install_lib, lib_dir)

Arguments

pkg

the package name

install_lib

the library to install into (the real library for cran_to_main_lib, else the throwaway lib_dir)

lib_dir

the throwaway library (checked for loadability, same as the caller's main install path)

Value

a list ok (logical), msg (character, error text on failure), version (the Archive version installed, or NA)