Deletes all objects from a package's user-cache pins board that exceed a certain max_age. If board is pkg_versioned, additionally deletes all
user-cache pins boards belonging to versions of the package other than the currently installed one.
Arguments
- board
- max_age
Age above which cached objects will be deleted. A valid lubridate duration. Defaults to 1 day (24 hours).
See also
Other package cache management functions:
board(),
ls_cache(),
path_cache(),
purge_cache(),
purge_caches()
Examples
if (FALSE) { # \dontrun{
# delete all cached results that are older than 7 days at once on package load:
.onLoad <- function(libname, pkgname) {
pkgpins::clear_cache(board = pkgpins::board(pkg = pkgname),
max_age = "7 days")
}} # }