pkg_cache_api: Functions to query and manipulate the package cache

Description Usage Arguments See Also Examples

Description

pkg_cache_summary() returns a short summary of the state of the cache, e.g. the number of files and their total size. It returns a named list.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
pkg_cache_summary(cachepath = NULL)

pkg_cache_list(cachepath = NULL)

pkg_cache_find(cachepath = NULL, ...)

pkg_cache_get_file(cachepath = NULL, target, ...)

pkg_cache_delete_files(cachepath = NULL, ...)

pkg_cache_add_file(cachepath = NULL, file, relpath = dirname(file), ...)

Arguments

cachepath

Path of the cache. By default the cache directory is in R-pkg, within the user's cache directory. See rappdirs::user_cache_dir().

...

Extra named arguments to select the package file.

target

Path where the selected file is copied.

file

File to add.

relpath

The relative path of the file within the cache.

See Also

The package_cache R6 class for a more flexible API.

Examples

1
2
3
4
5
6
pkg_cache_summary()
pkg_cache_list()
pkg_cache_find(package = "forecast")
tmp <- tempfile()
pkg_cache_get_file(target = tmp, package = "forecast", version = "8.10")
pkg_cache_delete_files(package = "forecast")

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