These are convenience wrappers around DBI package functions. They allow the user a bit of control over what is being cached.

clearCache(
  x,
  userTags = character(),
  after = NULL,
  before = NULL,
  ask = getOption("reproducible.ask"),
  useCloud = FALSE,
  cloudFolderID = getOption("reproducible.cloudFolderID", NULL),
  drv = getOption("reproducible.drv", RSQLite::SQLite()),
  conn = getOption("reproducible.conn", NULL),
  ...
)

# S4 method for ANY
clearCache(
  x,
  userTags = character(),
  after = NULL,
  before = NULL,
  ask = getOption("reproducible.ask"),
  useCloud = FALSE,
  cloudFolderID = getOption("reproducible.cloudFolderID", NULL),
  drv = getOption("reproducible.drv", RSQLite::SQLite()),
  conn = getOption("reproducible.conn", NULL),
  ...
)

cc(secs, ...)

showCache(
  x,
  userTags = character(),
  after = NULL,
  before = NULL,
  drv = getOption("reproducible.drv", RSQLite::SQLite()),
  conn = getOption("reproducible.conn", NULL),
  ...
)

# S4 method for ANY
showCache(
  x,
  userTags = character(),
  after = NULL,
  before = NULL,
  drv = getOption("reproducible.drv", RSQLite::SQLite()),
  conn = getOption("reproducible.conn", NULL),
  ...
)

keepCache(
  x,
  userTags = character(),
  after = NULL,
  before = NULL,
  ask = getOption("reproducible.ask"),
  drv = getOption("reproducible.drv", RSQLite::SQLite()),
  conn = getOption("reproducible.conn", NULL),
  ...
)

# S4 method for ANY
keepCache(
  x,
  userTags = character(),
  after = NULL,
  before = NULL,
  ask = getOption("reproducible.ask"),
  drv = getOption("reproducible.drv", RSQLite::SQLite()),
  conn = getOption("reproducible.conn", NULL),
  ...
)

Arguments

x

A simList or a directory containing a valid Cache repository. Note: For compatibility with Cache argument, cacheRepo can also be used instead of x, though x will take precedence.

userTags

Character vector. If used, this will be used in place of the after and before. Specifying one or more userTag here will clear all objects that match those tags. Matching is via regular expression, meaning partial matches will work unless strict beginning (^) and end ($) of string characters are used. Matching will be against any of the 3 columns returned by showCache(), i.e., artifact, tagValue or tagName. Also, length userTags > 1, then matching is by `and`. For `or` matching, use | in a single character string. See examples.

after

A time (POSIX, character understandable by data.table). Objects cached after this time will be shown or deleted.

before

A time (POSIX, character understandable by data.table). Objects cached before this time will be shown or deleted.

ask

Logical. If FALSE, then it will not ask to confirm deletions using clearCache or keepCache. Default is TRUE

useCloud

Logical. If TRUE, then every object that is deleted locally will also be deleted in the cloudFolderID, if it is non-NULL

cloudFolderID

A googledrive dribble of a folder, e.g., using drive_mkdir(). If left as NULL, the function will create a cloud folder with name from last two folder levels of the cacheRepo path, : paste0(basename(dirname(cacheRepo)), "_", basename(cacheRepo)). This cloudFolderID will be added to options("reproducible.cloudFolderID"), but this will not persist across sessions. If this is a character string, it will treat this as a folder name to create or use on GoogleDrive.

drv

an object that inherits from DBIDriver, or an existing DBIConnection object (in order to clone an existing connection).

conn

A DBIConnection object, as returned by dbConnect().

...

Other arguments. Currently, regexp, a logical, can be provided. This must be TRUE if the use is passing a regular expression. Otherwise, userTags will need to be exact matches. Default is missing, which is the same as TRUE. If there are errors due to regular expression problem, try FALSE. For cc, it is passed to clearCache, e.g., ask, userTags

secs

Currently 3 options: the number of seconds to pass to clearCache(after = secs), a POSIXct time e.g., from Sys.time(), or missing. If missing, the default, then it will delete the most recent entry in the Cache.

Value

Will clear all objects (or those that match userTags, or those between after or before) from the repository located at cachePath of the sim object, if sim is provided, or located in cacheRepo. Invisibly returns a data.table of the removed items.

Details

If neither after or before are provided, nor userTags, then all objects will be removed. If both after and before are specified, then all objects between after and before will be deleted. If userTags is used, this will override after or before.

cc(secs) is just a shortcut for clearCache(repo = Paths$cachePath, after = secs), i.e., to remove any cache entries touched in the last secs seconds.

clearCache

remove items from the cache based on their userTag or times values.

keepCache

remove all cached items except those based on certain userTags or times values.

showCache

display the contents of the cache.

Note

If the cache is larger than 10MB, and clearCache is used, there will be a message and a pause, if interactive, to prevent accidentally deleting of a large cache repository.

See also

mergeCache. Many more examples in Cache.

Examples

library(raster)

tmpDir <- file.path(tempdir(), "reproducible_examples", "Cache")
try(clearCache(tmpDir, ask = FALSE), silent = TRUE) # just to make sure it is clear

# Basic use
ranNumsA <- Cache(rnorm, 10, 16, cacheRepo = tmpDir)

# All same
ranNumsB <- Cache(rnorm, 10, 16, cacheRepo = tmpDir) # recovers cached copy
#>   ...(Object to retrieve (f11fb1a2880f8060.rds))
#>      loaded cached result from previous rnorm call
ranNumsD <- Cache(quote(rnorm(n = 10, 16)), cacheRepo = tmpDir) # recovers cached copy
#>   ...(Object to retrieve (f11fb1a2880f8060.rds))
#>      loaded cached result from previous rnorm call

# Any minor change makes it different
ranNumsE <- Cache(rnorm, 10, 6, cacheRepo = tmpDir) # different

## Example 1: basic cache use with tags
ranNumsA <- Cache(rnorm, 4, cacheRepo = tmpDir, userTags = "objectName:a")
ranNumsB <- Cache(runif, 4, cacheRepo = tmpDir, userTags = "objectName:b")
ranNumsC <- Cache(runif, 40, cacheRepo = tmpDir, userTags = "objectName:b")

showCache(tmpDir, userTags = c("objectName"))
#> Cache size: 
#>   Total (including Rasters): 828 bytes
#>   Selected objects (not including Rasters): 828 bytes
#>              cacheId              tagKey              tagValue
#>  1: 3aef38d1fc02aee5          objectName                     b
#>  2: 3aef38d1fc02aee5            function                 runif
#>  3: 3aef38d1fc02aee5               class               numeric
#>  4: 3aef38d1fc02aee5         object.size                  1008
#>  5: 3aef38d1fc02aee5            accessed   2022-08-18 15:37:35
#>  6: 3aef38d1fc02aee5             inCloud                 FALSE
#>  7: 3aef38d1fc02aee5          resultHash                      
#>  8: 3aef38d1fc02aee5   elapsedTimeDigest      0.000377655 secs
#>  9: 3aef38d1fc02aee5 elapsedTimeFirstRun     3.004074e-05 secs
#> 10: 3aef38d1fc02aee5      otherFunctions            build_site
#> 11: 3aef38d1fc02aee5      otherFunctions      build_site_local
#> 12: 3aef38d1fc02aee5      otherFunctions       build_reference
#> 13: 3aef38d1fc02aee5      otherFunctions  data_reference_topic
#> 14: 3aef38d1fc02aee5      otherFunctions          run_examples
#> 15: 3aef38d1fc02aee5      otherFunctions    highlight_examples
#> 16: 3aef38d1fc02aee5      otherFunctions             timing_fn
#> 17: 3aef38d1fc02aee5      otherFunctions                handle
#> 18: 3aef38d1fc02aee5      otherFunctions                   try
#> 19: 3aef38d1fc02aee5           preDigest    n:7eef4eae85fd9229
#> 20: 3aef38d1fc02aee5           preDigest .FUN:881ec847b7161f3c
#> 21: 3aef38d1fc02aee5           file.size                   170
#> 22: 7225b47fe5dc51d0          objectName                     b
#> 23: 7225b47fe5dc51d0            function                 runif
#> 24: 7225b47fe5dc51d0               class               numeric
#> 25: 7225b47fe5dc51d0         object.size                  1296
#> 26: 7225b47fe5dc51d0            accessed   2022-08-18 15:37:35
#> 27: 7225b47fe5dc51d0             inCloud                 FALSE
#> 28: 7225b47fe5dc51d0          resultHash                      
#> 29: 7225b47fe5dc51d0   elapsedTimeDigest     0.0003056526 secs
#> 30: 7225b47fe5dc51d0 elapsedTimeFirstRun     2.861023e-05 secs
#> 31: 7225b47fe5dc51d0      otherFunctions            build_site
#> 32: 7225b47fe5dc51d0      otherFunctions      build_site_local
#> 33: 7225b47fe5dc51d0      otherFunctions       build_reference
#> 34: 7225b47fe5dc51d0      otherFunctions  data_reference_topic
#> 35: 7225b47fe5dc51d0      otherFunctions          run_examples
#> 36: 7225b47fe5dc51d0      otherFunctions    highlight_examples
#> 37: 7225b47fe5dc51d0      otherFunctions             timing_fn
#> 38: 7225b47fe5dc51d0      otherFunctions                handle
#> 39: 7225b47fe5dc51d0      otherFunctions                   try
#> 40: 7225b47fe5dc51d0           preDigest    n:1393aef18608c8be
#> 41: 7225b47fe5dc51d0           preDigest .FUN:881ec847b7161f3c
#> 42: 7225b47fe5dc51d0           file.size                   393
#> 43: f7bee22047b8d0c1          objectName                     a
#> 44: f7bee22047b8d0c1            function                 rnorm
#> 45: f7bee22047b8d0c1               class               numeric
#> 46: f7bee22047b8d0c1         object.size                  1008
#> 47: f7bee22047b8d0c1            accessed   2022-08-18 15:37:35
#> 48: f7bee22047b8d0c1             inCloud                 FALSE
#> 49: f7bee22047b8d0c1          resultHash                      
#> 50: f7bee22047b8d0c1   elapsedTimeDigest     0.0003204346 secs
#> 51: f7bee22047b8d0c1 elapsedTimeFirstRun       3.0756e-05 secs
#> 52: f7bee22047b8d0c1      otherFunctions            build_site
#> 53: f7bee22047b8d0c1      otherFunctions      build_site_local
#> 54: f7bee22047b8d0c1      otherFunctions       build_reference
#> 55: f7bee22047b8d0c1      otherFunctions  data_reference_topic
#> 56: f7bee22047b8d0c1      otherFunctions          run_examples
#> 57: f7bee22047b8d0c1      otherFunctions    highlight_examples
#> 58: f7bee22047b8d0c1      otherFunctions             timing_fn
#> 59: f7bee22047b8d0c1      otherFunctions                handle
#> 60: f7bee22047b8d0c1      otherFunctions                   try
#> 61: f7bee22047b8d0c1           preDigest    n:7eef4eae85fd9229
#> 62: f7bee22047b8d0c1           preDigest .FUN:4f604aa46882b368
#> 63: f7bee22047b8d0c1           file.size                   175
#>              cacheId              tagKey              tagValue
#>             createdDate
#>  1: 2022-08-18 15:37:35
#>  2: 2022-08-18 15:37:35
#>  3: 2022-08-18 15:37:35
#>  4: 2022-08-18 15:37:35
#>  5: 2022-08-18 15:37:35
#>  6: 2022-08-18 15:37:35
#>  7: 2022-08-18 15:37:35
#>  8: 2022-08-18 15:37:35
#>  9: 2022-08-18 15:37:35
#> 10: 2022-08-18 15:37:35
#> 11: 2022-08-18 15:37:35
#> 12: 2022-08-18 15:37:35
#> 13: 2022-08-18 15:37:35
#> 14: 2022-08-18 15:37:35
#> 15: 2022-08-18 15:37:35
#> 16: 2022-08-18 15:37:35
#> 17: 2022-08-18 15:37:35
#> 18: 2022-08-18 15:37:35
#> 19: 2022-08-18 15:37:35
#> 20: 2022-08-18 15:37:35
#> 21: 2022-08-18 15:37:35
#> 22: 2022-08-18 15:37:35
#> 23: 2022-08-18 15:37:35
#> 24: 2022-08-18 15:37:35
#> 25: 2022-08-18 15:37:35
#> 26: 2022-08-18 15:37:35
#> 27: 2022-08-18 15:37:35
#> 28: 2022-08-18 15:37:35
#> 29: 2022-08-18 15:37:35
#> 30: 2022-08-18 15:37:35
#> 31: 2022-08-18 15:37:35
#> 32: 2022-08-18 15:37:35
#> 33: 2022-08-18 15:37:35
#> 34: 2022-08-18 15:37:35
#> 35: 2022-08-18 15:37:35
#> 36: 2022-08-18 15:37:35
#> 37: 2022-08-18 15:37:35
#> 38: 2022-08-18 15:37:35
#> 39: 2022-08-18 15:37:35
#> 40: 2022-08-18 15:37:35
#> 41: 2022-08-18 15:37:35
#> 42: 2022-08-18 15:37:35
#> 43: 2022-08-18 15:37:35
#> 44: 2022-08-18 15:37:35
#> 45: 2022-08-18 15:37:35
#> 46: 2022-08-18 15:37:35
#> 47: 2022-08-18 15:37:35
#> 48: 2022-08-18 15:37:35
#> 49: 2022-08-18 15:37:35
#> 50: 2022-08-18 15:37:35
#> 51: 2022-08-18 15:37:35
#> 52: 2022-08-18 15:37:35
#> 53: 2022-08-18 15:37:35
#> 54: 2022-08-18 15:37:35
#> 55: 2022-08-18 15:37:35
#> 56: 2022-08-18 15:37:35
#> 57: 2022-08-18 15:37:35
#> 58: 2022-08-18 15:37:35
#> 59: 2022-08-18 15:37:35
#> 60: 2022-08-18 15:37:35
#> 61: 2022-08-18 15:37:35
#> 62: 2022-08-18 15:37:35
#> 63: 2022-08-18 15:37:35
#>             createdDate
showCache(tmpDir, userTags = c("^a$")) # regular expression ... "a" exactly
#> Cache size: 
#>   Total (including Rasters): 252 bytes
#>   Selected objects (not including Rasters): 252 bytes
#>              cacheId              tagKey              tagValue
#>  1: f7bee22047b8d0c1          objectName                     a
#>  2: f7bee22047b8d0c1            function                 rnorm
#>  3: f7bee22047b8d0c1               class               numeric
#>  4: f7bee22047b8d0c1         object.size                  1008
#>  5: f7bee22047b8d0c1            accessed   2022-08-18 15:37:35
#>  6: f7bee22047b8d0c1             inCloud                 FALSE
#>  7: f7bee22047b8d0c1          resultHash                      
#>  8: f7bee22047b8d0c1   elapsedTimeDigest     0.0003204346 secs
#>  9: f7bee22047b8d0c1 elapsedTimeFirstRun       3.0756e-05 secs
#> 10: f7bee22047b8d0c1      otherFunctions            build_site
#> 11: f7bee22047b8d0c1      otherFunctions      build_site_local
#> 12: f7bee22047b8d0c1      otherFunctions       build_reference
#> 13: f7bee22047b8d0c1      otherFunctions  data_reference_topic
#> 14: f7bee22047b8d0c1      otherFunctions          run_examples
#> 15: f7bee22047b8d0c1      otherFunctions    highlight_examples
#> 16: f7bee22047b8d0c1      otherFunctions             timing_fn
#> 17: f7bee22047b8d0c1      otherFunctions                handle
#> 18: f7bee22047b8d0c1      otherFunctions                   try
#> 19: f7bee22047b8d0c1           preDigest    n:7eef4eae85fd9229
#> 20: f7bee22047b8d0c1           preDigest .FUN:4f604aa46882b368
#> 21: f7bee22047b8d0c1           file.size                   175
#>              cacheId              tagKey              tagValue
#>             createdDate
#>  1: 2022-08-18 15:37:35
#>  2: 2022-08-18 15:37:35
#>  3: 2022-08-18 15:37:35
#>  4: 2022-08-18 15:37:35
#>  5: 2022-08-18 15:37:35
#>  6: 2022-08-18 15:37:35
#>  7: 2022-08-18 15:37:35
#>  8: 2022-08-18 15:37:35
#>  9: 2022-08-18 15:37:35
#> 10: 2022-08-18 15:37:35
#> 11: 2022-08-18 15:37:35
#> 12: 2022-08-18 15:37:35
#> 13: 2022-08-18 15:37:35
#> 14: 2022-08-18 15:37:35
#> 15: 2022-08-18 15:37:35
#> 16: 2022-08-18 15:37:35
#> 17: 2022-08-18 15:37:35
#> 18: 2022-08-18 15:37:35
#> 19: 2022-08-18 15:37:35
#> 20: 2022-08-18 15:37:35
#> 21: 2022-08-18 15:37:35
#>             createdDate

# Fine control of cache elements -- pick out only the large runif object, and remove it
cache1 <- showCache(tmpDir, userTags = c("runif")) # show only cached objects made during runif
#> Cache size: 
#>   Total (including Rasters): 576 bytes
#>   Selected objects (not including Rasters): 576 bytes
toRemove <- cache1[tagKey == "object.size"][as.numeric(tagValue) > 700]$cacheId
clearCache(tmpDir, userTags = toRemove, ask = FALSE)
#> Cache size: 
#>   Total (including Rasters): 0 bytes
#>   Selected objects (not including Rasters): 0 bytes
cacheAfter <- showCache(tmpDir, userTags = c("runif")) # Only the small one is left
#> Cache size: 
#>   Total (including Rasters): 576 bytes
#>   Selected objects (not including Rasters): 576 bytes

tmpDir <- file.path(tempdir(), "reproducible_examples", "Cache")
try(clearCache(tmpDir, ask = FALSE), silent = TRUE) # just to make sure it is clear

Cache(rnorm, 1, cacheRepo = tmpDir)
#> [1] 0.4897681
#> attr(,".Cache")
#> attr(,".Cache")$newCache
#> [1] TRUE
#> 
#> attr(,"tags")
#> [1] "cacheId:7072c305d8c69df0"
#> attr(,"call")
#> [1] ""
thisTime <- Sys.time()
Cache(rnorm, 2, cacheRepo = tmpDir)
#> [1]  0.9749815 -0.9974435
#> attr(,".Cache")
#> attr(,".Cache")$newCache
#> [1] TRUE
#> 
#> attr(,"tags")
#> [1] "cacheId:3b347dee8f6305c7"
#> attr(,"call")
#> [1] ""
Cache(rnorm, 3, cacheRepo = tmpDir)
#> [1]  0.6722839 -1.0366604 -1.0593591
#> attr(,".Cache")
#> attr(,".Cache")$newCache
#> [1] TRUE
#> 
#> attr(,"tags")
#> [1] "cacheId:f0da91a44b839434"
#> attr(,"call")
#> [1] ""
Cache(rnorm, 4, cacheRepo = tmpDir)
#> [1]  0.1703881  1.5806289  0.2259156 -0.1740085
#> attr(,".Cache")
#> attr(,".Cache")$newCache
#> [1] TRUE
#> 
#> attr(,"tags")
#> [1] "cacheId:f7bee22047b8d0c1"
#> attr(,"call")
#> [1] ""
showCache(x = tmpDir) # shows all 4 entries
#> Cache size: 
#>   Total (including Rasters): 998 bytes
#>   Selected objects (not including Rasters): 998 bytes
#>              cacheId              tagKey              tagValue
#>  1: 7072c305d8c69df0            function                 rnorm
#>  2: 7072c305d8c69df0               class               numeric
#>  3: 7072c305d8c69df0         object.size                   984
#>  4: 7072c305d8c69df0            accessed   2022-08-18 15:37:35
#>  5: 7072c305d8c69df0             inCloud                 FALSE
#>  6: 7072c305d8c69df0          resultHash                      
#>  7: 7072c305d8c69df0   elapsedTimeDigest     0.0003700256 secs
#>  8: 7072c305d8c69df0 elapsedTimeFirstRun     3.027916e-05 secs
#>  9: 7072c305d8c69df0      otherFunctions            build_site
#> 10: 7072c305d8c69df0      otherFunctions      build_site_local
#> 11: 7072c305d8c69df0      otherFunctions       build_reference
#> 12: 7072c305d8c69df0      otherFunctions  data_reference_topic
#> 13: 7072c305d8c69df0      otherFunctions          run_examples
#> 14: 7072c305d8c69df0      otherFunctions    highlight_examples
#> 15: 7072c305d8c69df0      otherFunctions             timing_fn
#> 16: 7072c305d8c69df0      otherFunctions                handle
#> 17: 7072c305d8c69df0      otherFunctions                   try
#> 18: 7072c305d8c69df0           preDigest    n:853b1797f54b229c
#> 19: 7072c305d8c69df0           preDigest .FUN:4f604aa46882b368
#> 20: 7072c305d8c69df0           file.size                   148
#> 21: 3b347dee8f6305c7            function                 rnorm
#> 22: 3b347dee8f6305c7               class               numeric
#> 23: 3b347dee8f6305c7         object.size                   992
#> 24: 3b347dee8f6305c7            accessed   2022-08-18 15:37:35
#> 25: 3b347dee8f6305c7             inCloud                 FALSE
#> 26: 3b347dee8f6305c7          resultHash                      
#> 27: 3b347dee8f6305c7   elapsedTimeDigest     0.0003201962 secs
#> 28: 3b347dee8f6305c7 elapsedTimeFirstRun       3.0756e-05 secs
#> 29: 3b347dee8f6305c7      otherFunctions            build_site
#> 30: 3b347dee8f6305c7      otherFunctions      build_site_local
#> 31: 3b347dee8f6305c7      otherFunctions       build_reference
#> 32: 3b347dee8f6305c7      otherFunctions  data_reference_topic
#> 33: 3b347dee8f6305c7      otherFunctions          run_examples
#> 34: 3b347dee8f6305c7      otherFunctions    highlight_examples
#> 35: 3b347dee8f6305c7      otherFunctions             timing_fn
#> 36: 3b347dee8f6305c7      otherFunctions                handle
#> 37: 3b347dee8f6305c7      otherFunctions                   try
#> 38: 3b347dee8f6305c7           preDigest    n:82dc709f2b91918a
#> 39: 3b347dee8f6305c7           preDigest .FUN:4f604aa46882b368
#> 40: 3b347dee8f6305c7           file.size                   157
#> 41: f0da91a44b839434            function                 rnorm
#> 42: f0da91a44b839434               class               numeric
#> 43: f0da91a44b839434         object.size                  1008
#> 44: f0da91a44b839434            accessed   2022-08-18 15:37:35
#> 45: f0da91a44b839434             inCloud                 FALSE
#> 46: f0da91a44b839434          resultHash                      
#> 47: f0da91a44b839434   elapsedTimeDigest     0.0003168583 secs
#> 48: f0da91a44b839434 elapsedTimeFirstRun     2.980232e-05 secs
#> 49: f0da91a44b839434      otherFunctions            build_site
#> 50: f0da91a44b839434      otherFunctions      build_site_local
#> 51: f0da91a44b839434      otherFunctions       build_reference
#> 52: f0da91a44b839434      otherFunctions  data_reference_topic
#> 53: f0da91a44b839434      otherFunctions          run_examples
#> 54: f0da91a44b839434      otherFunctions    highlight_examples
#> 55: f0da91a44b839434      otherFunctions             timing_fn
#> 56: f0da91a44b839434      otherFunctions                handle
#> 57: f0da91a44b839434      otherFunctions                   try
#> 58: f0da91a44b839434           preDigest    n:7f12988bd88a0fb8
#> 59: f0da91a44b839434           preDigest .FUN:4f604aa46882b368
#> 60: f0da91a44b839434           file.size                   165
#> 61: f7bee22047b8d0c1            function                 rnorm
#> 62: f7bee22047b8d0c1               class               numeric
#> 63: f7bee22047b8d0c1         object.size                  1008
#> 64: f7bee22047b8d0c1            accessed   2022-08-18 15:37:35
#> 65: f7bee22047b8d0c1             inCloud                 FALSE
#> 66: f7bee22047b8d0c1          resultHash                      
#> 67: f7bee22047b8d0c1   elapsedTimeDigest     0.0003185272 secs
#> 68: f7bee22047b8d0c1 elapsedTimeFirstRun     3.027916e-05 secs
#> 69: f7bee22047b8d0c1      otherFunctions            build_site
#> 70: f7bee22047b8d0c1      otherFunctions      build_site_local
#> 71: f7bee22047b8d0c1      otherFunctions       build_reference
#> 72: f7bee22047b8d0c1      otherFunctions  data_reference_topic
#> 73: f7bee22047b8d0c1      otherFunctions          run_examples
#> 74: f7bee22047b8d0c1      otherFunctions    highlight_examples
#> 75: f7bee22047b8d0c1      otherFunctions             timing_fn
#> 76: f7bee22047b8d0c1      otherFunctions                handle
#> 77: f7bee22047b8d0c1      otherFunctions                   try
#> 78: f7bee22047b8d0c1           preDigest    n:7eef4eae85fd9229
#> 79: f7bee22047b8d0c1           preDigest .FUN:4f604aa46882b368
#> 80: f7bee22047b8d0c1           file.size                   174
#>              cacheId              tagKey              tagValue
#>             createdDate
#>  1: 2022-08-18 15:37:35
#>  2: 2022-08-18 15:37:35
#>  3: 2022-08-18 15:37:35
#>  4: 2022-08-18 15:37:35
#>  5: 2022-08-18 15:37:35
#>  6: 2022-08-18 15:37:35
#>  7: 2022-08-18 15:37:35
#>  8: 2022-08-18 15:37:35
#>  9: 2022-08-18 15:37:35
#> 10: 2022-08-18 15:37:35
#> 11: 2022-08-18 15:37:35
#> 12: 2022-08-18 15:37:35
#> 13: 2022-08-18 15:37:35
#> 14: 2022-08-18 15:37:35
#> 15: 2022-08-18 15:37:35
#> 16: 2022-08-18 15:37:35
#> 17: 2022-08-18 15:37:35
#> 18: 2022-08-18 15:37:35
#> 19: 2022-08-18 15:37:35
#> 20: 2022-08-18 15:37:35
#> 21: 2022-08-18 15:37:35
#> 22: 2022-08-18 15:37:35
#> 23: 2022-08-18 15:37:35
#> 24: 2022-08-18 15:37:35
#> 25: 2022-08-18 15:37:35
#> 26: 2022-08-18 15:37:35
#> 27: 2022-08-18 15:37:35
#> 28: 2022-08-18 15:37:35
#> 29: 2022-08-18 15:37:35
#> 30: 2022-08-18 15:37:35
#> 31: 2022-08-18 15:37:35
#> 32: 2022-08-18 15:37:35
#> 33: 2022-08-18 15:37:35
#> 34: 2022-08-18 15:37:35
#> 35: 2022-08-18 15:37:35
#> 36: 2022-08-18 15:37:35
#> 37: 2022-08-18 15:37:35
#> 38: 2022-08-18 15:37:35
#> 39: 2022-08-18 15:37:35
#> 40: 2022-08-18 15:37:35
#> 41: 2022-08-18 15:37:35
#> 42: 2022-08-18 15:37:35
#> 43: 2022-08-18 15:37:35
#> 44: 2022-08-18 15:37:35
#> 45: 2022-08-18 15:37:35
#> 46: 2022-08-18 15:37:35
#> 47: 2022-08-18 15:37:35
#> 48: 2022-08-18 15:37:35
#> 49: 2022-08-18 15:37:35
#> 50: 2022-08-18 15:37:35
#> 51: 2022-08-18 15:37:35
#> 52: 2022-08-18 15:37:35
#> 53: 2022-08-18 15:37:35
#> 54: 2022-08-18 15:37:35
#> 55: 2022-08-18 15:37:35
#> 56: 2022-08-18 15:37:35
#> 57: 2022-08-18 15:37:35
#> 58: 2022-08-18 15:37:35
#> 59: 2022-08-18 15:37:35
#> 60: 2022-08-18 15:37:35
#> 61: 2022-08-18 15:37:35
#> 62: 2022-08-18 15:37:35
#> 63: 2022-08-18 15:37:35
#> 64: 2022-08-18 15:37:35
#> 65: 2022-08-18 15:37:35
#> 66: 2022-08-18 15:37:35
#> 67: 2022-08-18 15:37:35
#> 68: 2022-08-18 15:37:35
#> 69: 2022-08-18 15:37:35
#> 70: 2022-08-18 15:37:35
#> 71: 2022-08-18 15:37:35
#> 72: 2022-08-18 15:37:35
#> 73: 2022-08-18 15:37:35
#> 74: 2022-08-18 15:37:35
#> 75: 2022-08-18 15:37:35
#> 76: 2022-08-18 15:37:35
#> 77: 2022-08-18 15:37:35
#> 78: 2022-08-18 15:37:35
#> 79: 2022-08-18 15:37:35
#> 80: 2022-08-18 15:37:35
#>             createdDate
cc(ask = FALSE, x = tmpDir)
#> No time provided; removing the most recent entry to the Cache
#> Cache size: 
#>   Total (including Rasters): 252 bytes
#>   Selected objects (not including Rasters): 252 bytes
showCache(x = tmpDir) # most recent is gone
#> Cache size: 
#>   Total (including Rasters): 746 bytes
#>   Selected objects (not including Rasters): 746 bytes
#>              cacheId              tagKey              tagValue
#>  1: 7072c305d8c69df0            function                 rnorm
#>  2: 7072c305d8c69df0               class               numeric
#>  3: 7072c305d8c69df0         object.size                   984
#>  4: 7072c305d8c69df0            accessed   2022-08-18 15:37:35
#>  5: 7072c305d8c69df0             inCloud                 FALSE
#>  6: 7072c305d8c69df0          resultHash                      
#>  7: 7072c305d8c69df0   elapsedTimeDigest     0.0003700256 secs
#>  8: 7072c305d8c69df0 elapsedTimeFirstRun     3.027916e-05 secs
#>  9: 7072c305d8c69df0      otherFunctions            build_site
#> 10: 7072c305d8c69df0      otherFunctions      build_site_local
#> 11: 7072c305d8c69df0      otherFunctions       build_reference
#> 12: 7072c305d8c69df0      otherFunctions  data_reference_topic
#> 13: 7072c305d8c69df0      otherFunctions          run_examples
#> 14: 7072c305d8c69df0      otherFunctions    highlight_examples
#> 15: 7072c305d8c69df0      otherFunctions             timing_fn
#> 16: 7072c305d8c69df0      otherFunctions                handle
#> 17: 7072c305d8c69df0      otherFunctions                   try
#> 18: 7072c305d8c69df0           preDigest    n:853b1797f54b229c
#> 19: 7072c305d8c69df0           preDigest .FUN:4f604aa46882b368
#> 20: 7072c305d8c69df0           file.size                   148
#> 21: 3b347dee8f6305c7            function                 rnorm
#> 22: 3b347dee8f6305c7               class               numeric
#> 23: 3b347dee8f6305c7         object.size                   992
#> 24: 3b347dee8f6305c7            accessed   2022-08-18 15:37:35
#> 25: 3b347dee8f6305c7             inCloud                 FALSE
#> 26: 3b347dee8f6305c7          resultHash                      
#> 27: 3b347dee8f6305c7   elapsedTimeDigest     0.0003201962 secs
#> 28: 3b347dee8f6305c7 elapsedTimeFirstRun       3.0756e-05 secs
#> 29: 3b347dee8f6305c7      otherFunctions            build_site
#> 30: 3b347dee8f6305c7      otherFunctions      build_site_local
#> 31: 3b347dee8f6305c7      otherFunctions       build_reference
#> 32: 3b347dee8f6305c7      otherFunctions  data_reference_topic
#> 33: 3b347dee8f6305c7      otherFunctions          run_examples
#> 34: 3b347dee8f6305c7      otherFunctions    highlight_examples
#> 35: 3b347dee8f6305c7      otherFunctions             timing_fn
#> 36: 3b347dee8f6305c7      otherFunctions                handle
#> 37: 3b347dee8f6305c7      otherFunctions                   try
#> 38: 3b347dee8f6305c7           preDigest    n:82dc709f2b91918a
#> 39: 3b347dee8f6305c7           preDigest .FUN:4f604aa46882b368
#> 40: 3b347dee8f6305c7           file.size                   157
#> 41: f0da91a44b839434            function                 rnorm
#> 42: f0da91a44b839434               class               numeric
#> 43: f0da91a44b839434         object.size                  1008
#> 44: f0da91a44b839434            accessed   2022-08-18 15:37:35
#> 45: f0da91a44b839434             inCloud                 FALSE
#> 46: f0da91a44b839434          resultHash                      
#> 47: f0da91a44b839434   elapsedTimeDigest     0.0003168583 secs
#> 48: f0da91a44b839434 elapsedTimeFirstRun     2.980232e-05 secs
#> 49: f0da91a44b839434      otherFunctions            build_site
#> 50: f0da91a44b839434      otherFunctions      build_site_local
#> 51: f0da91a44b839434      otherFunctions       build_reference
#> 52: f0da91a44b839434      otherFunctions  data_reference_topic
#> 53: f0da91a44b839434      otherFunctions          run_examples
#> 54: f0da91a44b839434      otherFunctions    highlight_examples
#> 55: f0da91a44b839434      otherFunctions             timing_fn
#> 56: f0da91a44b839434      otherFunctions                handle
#> 57: f0da91a44b839434      otherFunctions                   try
#> 58: f0da91a44b839434           preDigest    n:7f12988bd88a0fb8
#> 59: f0da91a44b839434           preDigest .FUN:4f604aa46882b368
#> 60: f0da91a44b839434           file.size                   165
#>              cacheId              tagKey              tagValue
#>             createdDate
#>  1: 2022-08-18 15:37:35
#>  2: 2022-08-18 15:37:35
#>  3: 2022-08-18 15:37:35
#>  4: 2022-08-18 15:37:35
#>  5: 2022-08-18 15:37:35
#>  6: 2022-08-18 15:37:35
#>  7: 2022-08-18 15:37:35
#>  8: 2022-08-18 15:37:35
#>  9: 2022-08-18 15:37:35
#> 10: 2022-08-18 15:37:35
#> 11: 2022-08-18 15:37:35
#> 12: 2022-08-18 15:37:35
#> 13: 2022-08-18 15:37:35
#> 14: 2022-08-18 15:37:35
#> 15: 2022-08-18 15:37:35
#> 16: 2022-08-18 15:37:35
#> 17: 2022-08-18 15:37:35
#> 18: 2022-08-18 15:37:35
#> 19: 2022-08-18 15:37:35
#> 20: 2022-08-18 15:37:35
#> 21: 2022-08-18 15:37:35
#> 22: 2022-08-18 15:37:35
#> 23: 2022-08-18 15:37:35
#> 24: 2022-08-18 15:37:35
#> 25: 2022-08-18 15:37:35
#> 26: 2022-08-18 15:37:35
#> 27: 2022-08-18 15:37:35
#> 28: 2022-08-18 15:37:35
#> 29: 2022-08-18 15:37:35
#> 30: 2022-08-18 15:37:35
#> 31: 2022-08-18 15:37:35
#> 32: 2022-08-18 15:37:35
#> 33: 2022-08-18 15:37:35
#> 34: 2022-08-18 15:37:35
#> 35: 2022-08-18 15:37:35
#> 36: 2022-08-18 15:37:35
#> 37: 2022-08-18 15:37:35
#> 38: 2022-08-18 15:37:35
#> 39: 2022-08-18 15:37:35
#> 40: 2022-08-18 15:37:35
#> 41: 2022-08-18 15:37:35
#> 42: 2022-08-18 15:37:35
#> 43: 2022-08-18 15:37:35
#> 44: 2022-08-18 15:37:35
#> 45: 2022-08-18 15:37:35
#> 46: 2022-08-18 15:37:35
#> 47: 2022-08-18 15:37:35
#> 48: 2022-08-18 15:37:35
#> 49: 2022-08-18 15:37:35
#> 50: 2022-08-18 15:37:35
#> 51: 2022-08-18 15:37:35
#> 52: 2022-08-18 15:37:35
#> 53: 2022-08-18 15:37:35
#> 54: 2022-08-18 15:37:35
#> 55: 2022-08-18 15:37:35
#> 56: 2022-08-18 15:37:35
#> 57: 2022-08-18 15:37:35
#> 58: 2022-08-18 15:37:35
#> 59: 2022-08-18 15:37:35
#> 60: 2022-08-18 15:37:35
#>             createdDate
cc(thisTime, ask = FALSE, x = tmpDir)
#> Cache size: 
#>   Total (including Rasters): 0 bytes
#>   Selected objects (not including Rasters): 0 bytes
showCache(x = tmpDir) # all those after thisTime gone, i.e., only 1 left
#> Cache size: 
#>   Total (including Rasters): 746 bytes
#>   Selected objects (not including Rasters): 746 bytes
#>              cacheId              tagKey              tagValue
#>  1: 7072c305d8c69df0            function                 rnorm
#>  2: 7072c305d8c69df0               class               numeric
#>  3: 7072c305d8c69df0         object.size                   984
#>  4: 7072c305d8c69df0            accessed   2022-08-18 15:37:35
#>  5: 7072c305d8c69df0             inCloud                 FALSE
#>  6: 7072c305d8c69df0          resultHash                      
#>  7: 7072c305d8c69df0   elapsedTimeDigest     0.0003700256 secs
#>  8: 7072c305d8c69df0 elapsedTimeFirstRun     3.027916e-05 secs
#>  9: 7072c305d8c69df0      otherFunctions            build_site
#> 10: 7072c305d8c69df0      otherFunctions      build_site_local
#> 11: 7072c305d8c69df0      otherFunctions       build_reference
#> 12: 7072c305d8c69df0      otherFunctions  data_reference_topic
#> 13: 7072c305d8c69df0      otherFunctions          run_examples
#> 14: 7072c305d8c69df0      otherFunctions    highlight_examples
#> 15: 7072c305d8c69df0      otherFunctions             timing_fn
#> 16: 7072c305d8c69df0      otherFunctions                handle
#> 17: 7072c305d8c69df0      otherFunctions                   try
#> 18: 7072c305d8c69df0           preDigest    n:853b1797f54b229c
#> 19: 7072c305d8c69df0           preDigest .FUN:4f604aa46882b368
#> 20: 7072c305d8c69df0           file.size                   148
#> 21: 3b347dee8f6305c7            function                 rnorm
#> 22: 3b347dee8f6305c7               class               numeric
#> 23: 3b347dee8f6305c7         object.size                   992
#> 24: 3b347dee8f6305c7            accessed   2022-08-18 15:37:35
#> 25: 3b347dee8f6305c7             inCloud                 FALSE
#> 26: 3b347dee8f6305c7          resultHash                      
#> 27: 3b347dee8f6305c7   elapsedTimeDigest     0.0003201962 secs
#> 28: 3b347dee8f6305c7 elapsedTimeFirstRun       3.0756e-05 secs
#> 29: 3b347dee8f6305c7      otherFunctions            build_site
#> 30: 3b347dee8f6305c7      otherFunctions      build_site_local
#> 31: 3b347dee8f6305c7      otherFunctions       build_reference
#> 32: 3b347dee8f6305c7      otherFunctions  data_reference_topic
#> 33: 3b347dee8f6305c7      otherFunctions          run_examples
#> 34: 3b347dee8f6305c7      otherFunctions    highlight_examples
#> 35: 3b347dee8f6305c7      otherFunctions             timing_fn
#> 36: 3b347dee8f6305c7      otherFunctions                handle
#> 37: 3b347dee8f6305c7      otherFunctions                   try
#> 38: 3b347dee8f6305c7           preDigest    n:82dc709f2b91918a
#> 39: 3b347dee8f6305c7           preDigest .FUN:4f604aa46882b368
#> 40: 3b347dee8f6305c7           file.size                   157
#> 41: f0da91a44b839434            function                 rnorm
#> 42: f0da91a44b839434               class               numeric
#> 43: f0da91a44b839434         object.size                  1008
#> 44: f0da91a44b839434            accessed   2022-08-18 15:37:35
#> 45: f0da91a44b839434             inCloud                 FALSE
#> 46: f0da91a44b839434          resultHash                      
#> 47: f0da91a44b839434   elapsedTimeDigest     0.0003168583 secs
#> 48: f0da91a44b839434 elapsedTimeFirstRun     2.980232e-05 secs
#> 49: f0da91a44b839434      otherFunctions            build_site
#> 50: f0da91a44b839434      otherFunctions      build_site_local
#> 51: f0da91a44b839434      otherFunctions       build_reference
#> 52: f0da91a44b839434      otherFunctions  data_reference_topic
#> 53: f0da91a44b839434      otherFunctions          run_examples
#> 54: f0da91a44b839434      otherFunctions    highlight_examples
#> 55: f0da91a44b839434      otherFunctions             timing_fn
#> 56: f0da91a44b839434      otherFunctions                handle
#> 57: f0da91a44b839434      otherFunctions                   try
#> 58: f0da91a44b839434           preDigest    n:7f12988bd88a0fb8
#> 59: f0da91a44b839434           preDigest .FUN:4f604aa46882b368
#> 60: f0da91a44b839434           file.size                   165
#>              cacheId              tagKey              tagValue
#>             createdDate
#>  1: 2022-08-18 15:37:35
#>  2: 2022-08-18 15:37:35
#>  3: 2022-08-18 15:37:35
#>  4: 2022-08-18 15:37:35
#>  5: 2022-08-18 15:37:35
#>  6: 2022-08-18 15:37:35
#>  7: 2022-08-18 15:37:35
#>  8: 2022-08-18 15:37:35
#>  9: 2022-08-18 15:37:35
#> 10: 2022-08-18 15:37:35
#> 11: 2022-08-18 15:37:35
#> 12: 2022-08-18 15:37:35
#> 13: 2022-08-18 15:37:35
#> 14: 2022-08-18 15:37:35
#> 15: 2022-08-18 15:37:35
#> 16: 2022-08-18 15:37:35
#> 17: 2022-08-18 15:37:35
#> 18: 2022-08-18 15:37:35
#> 19: 2022-08-18 15:37:35
#> 20: 2022-08-18 15:37:35
#> 21: 2022-08-18 15:37:35
#> 22: 2022-08-18 15:37:35
#> 23: 2022-08-18 15:37:35
#> 24: 2022-08-18 15:37:35
#> 25: 2022-08-18 15:37:35
#> 26: 2022-08-18 15:37:35
#> 27: 2022-08-18 15:37:35
#> 28: 2022-08-18 15:37:35
#> 29: 2022-08-18 15:37:35
#> 30: 2022-08-18 15:37:35
#> 31: 2022-08-18 15:37:35
#> 32: 2022-08-18 15:37:35
#> 33: 2022-08-18 15:37:35
#> 34: 2022-08-18 15:37:35
#> 35: 2022-08-18 15:37:35
#> 36: 2022-08-18 15:37:35
#> 37: 2022-08-18 15:37:35
#> 38: 2022-08-18 15:37:35
#> 39: 2022-08-18 15:37:35
#> 40: 2022-08-18 15:37:35
#> 41: 2022-08-18 15:37:35
#> 42: 2022-08-18 15:37:35
#> 43: 2022-08-18 15:37:35
#> 44: 2022-08-18 15:37:35
#> 45: 2022-08-18 15:37:35
#> 46: 2022-08-18 15:37:35
#> 47: 2022-08-18 15:37:35
#> 48: 2022-08-18 15:37:35
#> 49: 2022-08-18 15:37:35
#> 50: 2022-08-18 15:37:35
#> 51: 2022-08-18 15:37:35
#> 52: 2022-08-18 15:37:35
#> 53: 2022-08-18 15:37:35
#> 54: 2022-08-18 15:37:35
#> 55: 2022-08-18 15:37:35
#> 56: 2022-08-18 15:37:35
#> 57: 2022-08-18 15:37:35
#> 58: 2022-08-18 15:37:35
#> 59: 2022-08-18 15:37:35
#> 60: 2022-08-18 15:37:35
#>             createdDate
cc(ask = FALSE, x = tmpDir) # Cache is
#> No time provided; removing the most recent entry to the Cache
#> Cache size: 
#>   Total (including Rasters): 252 bytes
#>   Selected objects (not including Rasters): 252 bytes
cc(ask = FALSE, x = tmpDir) # Cache is already empty
#> No time provided; removing the most recent entry to the Cache
#> Cache size: 
#>   Total (including Rasters): 248 bytes
#>   Selected objects (not including Rasters): 248 bytes