Datamonger

Select and Manage the Private R Cache

Datamonger for R · r · 0.2.0

datamonger_cache_dir

Datamonger uses the cache returned by tools::R_user_dir() by default. An explicit path can select another persistent or temporary location. Eviction is manual, and active objects are skipped.

Usage

datamonger_cache_dir(cache_dir = NULL)
cache_info(cache_dir = NULL)
cache_clean(dataset = NULL, older_than = NULL, cache_dir = NULL)

Arguments

cache_dir

An explicit cache path, or NULL for the platform default.

dataset

A canonical source:name@version filter.

older_than

A nonnegative difftime or number of seconds.

Value

datamonger_cache_dir() returns a path without creating it. cache_info() returns a cache inventory. cache_clean() reports removed and skipped objects and the number of bytes removed.

Examples

cache <- datamonger_cache_dir(tempfile("datamonger-cache-"))
dir.create(cache)
cache_info(cache_dir = cache)
cache_clean(cache_dir = cache)
unlink(cache, recursive = TRUE)
<datamonger_cache_info>
  location: /tmp/RtmpxwLIck/datamonger-cache-242e33051be8
  entries: 0
  total_size: 0 bytes
$location
[1] "/tmp/RtmpxwLIck/datamonger-cache-242e33051be8"

$removed
list()

$skipped
list()

$bytes_removed
[1] 0

attr(,"class")
[1] "datamonger_cache_clean_result"

Help topic: datamonger_cache_dir