cran_archive_cache: Cache for CRAN archive data

Description Details Usage Arguments Details Columns Examples

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
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

1
2
3
arch <- cran_archive_cache$new()
arch$update()
arch$list()

pkgcache documentation built on May 20, 2021, 1:06 a.m.