cran_archive_list: Data about older versions of CRAN packages

View source: R/archive.R

cran_archive_listR Documentation

Data about older versions of CRAN packages

Description

CRAN mirrors store older versions of packages in ⁠/src/contrib/Archive⁠, and they also store some metadata about them in ⁠/src/contrib/Meta/archive.rds⁠. pkgcache can download and cache this metadata.

Usage

cran_archive_list(
  cran_mirror = default_cran_mirror(),
  update_after = as.difftime(7, units = "days"),
  packages = NULL
)

cran_archive_update(cran_mirror = default_cran_mirror())

cran_archive_cleanup(cran_mirror = default_cran_mirror(), force = FALSE)

cran_archive_summary(cran_mirror = default_cran_mirror())

Arguments

cran_mirror

CRAN mirror to use, see default_cran_mirror().

update_after

difftime object. Automatically update the cache if it gets older than this. Set it to Inf to avoid updates. Defaults to seven days.

packages

Character vector. Only report these packages.

force

Force cleanup in non-interactive mode.

Details

cran_archive_list() lists all versions of all (or some) packages. It updates the cached data first, if it is older than the specified limit.

cran_archive_update() updates the archive cache.

cran_archive_cleanup() cleans up the archive cache for cran_mirror.

cran_archive_summary() prints a summary about the archive cache.

Value

cran_archive_list() returns a data frame with columns:

  • package: package name,

  • version: package version. This is a character vector, and not a package_version() object. Some older package versions are not supported by package_version().

  • raw: the raw row names from the CRAN metadata.

  • mtime: mtime column from the CRAN metadata. This is usually pretty close to the release date and time of the package.

  • url: package download URL.

  • mirror: CRAN mirror that was used to get this data. The output is ordered according to package names (case insensitive) and release dates.

cran_archive_update() returns all archive data in a data frame, in the same format as cran_archive_list(), invisibly.

cran_archive_cleanup() returns nothing.

cran_archive_summary() returns a named list with elements:

  • cachepath: Path to the directory that contains all archive cache.

  • current_rds: Path to the RDS file that contains the data for the specified cran_mirror.

  • lockfile: Path to the lock file for current_rds.

  • timestamp: Path to the time stamp for current_rds. NA if the cache is empty.

  • size: Size of current_rds. Zero if the cache is empty.

See Also

The cran_archive_cache class for more flexibility.

Examples


cran_archive_list(packages = "readr")


pkgcache documentation built on July 26, 2023, 5:44 p.m.