cran_archive_cache {pkgcache}R Documentation

Cache for CRAN archive data

Description

This is an R6 class that implements a cache from older CRAN package versions. For a higher level interface see the functions documented with cran_archive_list().

Details

The cache is similar to cranlike_metadata_cache and has the following layers:

It has a synchronous and an asynchronous API.

Usage

cac <- cran_archive_cache$new(
  primary_path = NULL,
  replica_path = tempfile(),
  cran_mirror = default_cran_mirror(),
  update_after = as.difftime(7, units = "days"),
)

cac$list(packages = NULL, update_after = NULL)
cac$async_list(packages = NULL, update_after = NULL)

cac$update()
cac$async_update()

cac$check_update()
cac$async_check_update()

cac$summary()

cac$cleanup(force = FALSE)

Arguments

Details

Create a new archive cache with cran_archive_cache$new(). Multiple caches are independent, so e.g. if you update one of them, the other existing caches are not affected.

cac$list() lists the versions of the specified packages, or all packages, if none were specified. cac$async_list() is the same, but asynchronous.

cac$update() updates the cache. It always downloads the new metadata. cac$async_update() is the same, but asynchronous.

cac$check_update() updates the cache if there is a newer version available. cac$async_check_update() is the same, but asynchronous.

cac$summary() returns a summary of the archive cache, a list with entries:

cac$cleanup() cleans up the cache files.

Columns

cac$list() returns a data frame with columns:

Examples


arch <- cran_archive_cache$new()
arch$update()
arch$list()


[Package pkgcache version 2.2.2 Index]