Description Usage Arguments Details Examples
Convenience function to cache to your own public or private Keybase folder
1 | cache_kb_self(cache_subdir, private = TRUE, algo = "sha512")
|
cache_subdir, private |
subdirectory under either |
algo |
The hashing algorithm used for the cache, see |
This ultimately uses cache_fs2()
, which means two additional functions are
provided in slots in the returned list:
location()
which will return the path to the cache directory
size()
which will compute and return the size of the cache (in bytes)
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()
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.