cache_kb_self: Convenience function to cache to your own public or private...

Description Usage Arguments Details Examples

View source: R/cache-kb.R

Description

Convenience function to cache to your own public or private Keybase folder

Usage

1
cache_kb_self(cache_subdir, private = TRUE, algo = "sha512")

Arguments

cache_subdir, private

subdirectory under either KB_HOME/private (if private is TRUE, the default) or KB_HOME/public if (private is FALSE). It will be created if it does not exist.

algo

The hashing algorithm used for the cache, see digest::digest() for available algorithms.

Details

This ultimately uses cache_fs2(), which means two additional functions are provided in slots in the returned list:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
if (tinytest::at_home()) {
kbc <- cache_kb_self(".cache")

kbc$location()

mrunif <- memoise::memoise(runif, cache = kbc)

mrunif(10) # First run, saves cache
mrunif(10) # Loads cache, results should be identical

kbc$keys()

kbc$size()

kbc$reset()

kbc$size()
}

hrbrmstr/kbmemoise documentation built on May 29, 2020, noon