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,
fun = NULL,
cacheId = NULL,
ask = getOption("reproducible.ask"),
useCloud = FALSE,
cloudFolderID = getOption("reproducible.cloudFolderID", NULL),
drv = getDrv(getOption("reproducible.drv", NULL)),
conn = getOption("reproducible.conn", NULL),
verbose = getOption("reproducible.verbose"),
...
)
# S4 method for class 'ANY'
clearCache(
x,
userTags = character(),
after = NULL,
before = NULL,
fun = NULL,
cacheId = NULL,
ask = getOption("reproducible.ask"),
useCloud = FALSE,
cloudFolderID = getOption("reproducible.cloudFolderID", NULL),
drv = getDrv(getOption("reproducible.drv", NULL)),
conn = getOption("reproducible.conn", NULL),
verbose = getOption("reproducible.verbose"),
...
)
cc(secs, ..., verbose = getOption("reproducible.verbose"))
showCache(
x,
userTags = character(),
after = NULL,
before = NULL,
fun = NULL,
cacheId = NULL,
drv = getDrv(getOption("reproducible.drv", NULL)),
conn = getOption("reproducible.conn", NULL),
verbose = getOption("reproducible.verbose"),
...
)
# S4 method for class 'ANY'
showCache(
x,
userTags = character(),
after = NULL,
before = NULL,
fun = NULL,
cacheId = NULL,
drv = getDrv(getOption("reproducible.drv", NULL)),
conn = getOption("reproducible.conn", NULL),
verbose = getOption("reproducible.verbose"),
...
)
keepCache(
x,
userTags = character(),
after = NULL,
before = NULL,
ask = getOption("reproducible.ask"),
drv = getDrv(getOption("reproducible.drv", NULL)),
conn = getOption("reproducible.conn", NULL),
verbose = getOption("reproducible.verbose"),
...
)
# S4 method for class 'ANY'
keepCache(
x,
userTags = character(),
after = NULL,
before = NULL,
ask = getOption("reproducible.ask"),
drv = getDrv(getOption("reproducible.drv", NULL)),
conn = getOption("reproducible.conn", NULL),
verbose = getOption("reproducible.verbose"),
...
)A simList or a directory containing a valid Cache repository. Note:
For compatibility with Cache argument, cachePath can also be
used instead of x, though x will take precedence.
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, if length(userTags) > 1, then matching is by and.
For or matching, use | in a single character string.
See examples.
A time (POSIX, character understandable by data.table). Objects cached after this time will be shown or deleted.
A time (POSIX, character understandable by data.table). Objects cached before this time will be shown or deleted.
An optional character vector describing the function name to extract. Only functions with this/these functions will be returned.
An optional character vector describing the cacheIds to extract.
Only entries with this/these cacheIds will be returned. If useDBI(FALSE),
this will also be dramatically faster than using userTags, for a large
cache.
Logical. If FALSE, then it will not ask to confirm deletions using
clearCache or keepCache. Default is TRUE
Logical. If TRUE, then every object that is deleted locally will
also be deleted in the cloudFolderID, if it is non-NULL
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 cachePath path, :
paste0(basename(dirname(cachePath)), "_", basename(cachePath)).
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.
If using a database backend, drv must be an object that
inherits from DBIDriver (e.g., RSQLite::SQLite).
an optional DBIConnection object, as returned by dbConnect().
Numeric, -1 silent (where possible), 0 being very quiet,
1 showing more messaging, 2 being more messaging, etc.
Default is 1. Above 3 will output much more information about the internals of
Caching, which may help diagnose Caching challenges. Can set globally with an
option, e.g., options('reproducible.verbose' = 0) to reduce to minimal
Other arguments. Can be in the form of tagKey = tagValue, such as,
class = "numeric" to find all entries that are numerics in the cache.
Note: the special cases of cacheId and fun have their own
named arguments in these functions.
Also can be regexp = xx, where xx is TRUE if the user
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. For showCache,
it can also be sorted = FALSE to return the object unsorted.
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.
Will clear all objects (or those that match userTags, or those
between after or before) from the repository located in
cachePath.
Invisibly returns a data.table of the removed items.
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 = currentRepo, after = secs),
i.e., to remove any cache entries touched in the last secs seconds. Since, secs
can be missing, this is also be a shorthand for "remove most recent entry from
the cache".
clearCacheremove items from the cache based on their
userTag or times values.
keepCacheremove all cached items except those based on
certain userTags or times values.
showCachedisplay the contents of the cache.
By default the return of showCache is sorted by cacheId. For convenience,
a user can optionally have it unsorted (passing sorted = FALSE),
which may be noticeably faster when
the cache is large (> 1e4 entries).
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.
mergeCache(). Many more examples in Cache().
data.table::setDTthreads(2)
tmpDir <- file.path(tempdir(), "reproducible_examples", "Cache")
try(clearCache(tmpDir, ask = FALSE), silent = TRUE) # just to make sure it is clear
#> Empty data.table (0 rows and 4 cols): cacheId,tagKey,tagValue,createdDate
# Basic use
ranNumsA <- Cache(rnorm, 10, 16, cachePath = tmpDir)
#> Saved! Cache file: aa549dd751b2f26d.rds; fn: rnorm
# All same
ranNumsB <- Cache(rnorm, 10, 16, cachePath = tmpDir) # recovers cached copy
#> Object to retrieve (fn: rnorm, aa549dd751b2f26d.rds) ...
#> Loaded! Cached result from previous rnorm call
ranNumsD <- Cache(quote(rnorm(n = 10, 16)), cachePath = tmpDir) # recovers cached copy
#> Object to retrieve (fn: rnorm, aa549dd751b2f26d.rds) ...
#> Loaded! Cached result from previous rnorm call
# Any minor change makes it different
ranNumsE <- Cache(rnorm, 10, 6, cachePath = tmpDir) # different
#> Saved! Cache file: d78b46a2a76d6d80.rds; fn: rnorm
## Example 1: basic cache use with tags
ranNumsA <- Cache(rnorm, 4, cachePath = tmpDir, userTags = "objectName:a")
#> Saved! Cache file: adf21923cd1e50d0.rds; fn: rnorm
ranNumsB <- Cache(runif, 4, cachePath = tmpDir, userTags = "objectName:b")
#> Saved! Cache file: e23cab430872a0ea.rds; fn: runif
ranNumsC <- Cache(runif, 40, cachePath = tmpDir, userTags = "objectName:b")
#> Saved! Cache file: 168438bfecab944b.rds; fn: runif
showCache(tmpDir, userTags = c("objectName"))
#> Cache size:
#> Total (including Rasters): 132 bytes
#> Selected objects (not including Rasters): 132 bytes
#> cacheId tagKey tagValue
#> <char> <char> <char>
#> 1: 168438bfecab944b function runif
#> 2: 168438bfecab944b objectName b
#> 3: 168438bfecab944b accessed 2026-01-08 05:48:53.49931
#> 4: 168438bfecab944b inCloud FALSE
#> 5: 168438bfecab944b elapsedTimeDigest 0.00117898 secs
#> 6: 168438bfecab944b preDigest .FUN:881ec847b7161f3c
#> 7: 168438bfecab944b preDigest max:853b1797f54b229c
#> 8: 168438bfecab944b preDigest min:c40c00762a0dac94
#> 9: 168438bfecab944b preDigest n:1393aef18608c8be
#> 10: 168438bfecab944b class numeric
#> 11: 168438bfecab944b object.size 368
#> 12: 168438bfecab944b fromDisk FALSE
#> 13: 168438bfecab944b resultHash
#> 14: 168438bfecab944b elapsedTimeFirstRun 0.0008859634 secs
#> 15: adf21923cd1e50d0 function rnorm
#> 16: adf21923cd1e50d0 objectName a
#> 17: adf21923cd1e50d0 accessed 2026-01-08 05:48:53.48864
#> 18: adf21923cd1e50d0 inCloud FALSE
#> 19: adf21923cd1e50d0 elapsedTimeDigest 0.001293659 secs
#> 20: adf21923cd1e50d0 preDigest .FUN:4f604aa46882b368
#> 21: adf21923cd1e50d0 preDigest mean:c40c00762a0dac94
#> 22: adf21923cd1e50d0 preDigest n:7eef4eae85fd9229
#> 23: adf21923cd1e50d0 preDigest sd:853b1797f54b229c
#> 24: adf21923cd1e50d0 class numeric
#> 25: adf21923cd1e50d0 object.size 80
#> 26: adf21923cd1e50d0 fromDisk FALSE
#> 27: adf21923cd1e50d0 resultHash
#> 28: adf21923cd1e50d0 elapsedTimeFirstRun 0.0009264946 secs
#> 29: e23cab430872a0ea function runif
#> 30: e23cab430872a0ea objectName b
#> 31: e23cab430872a0ea accessed 2026-01-08 05:48:53.49402
#> 32: e23cab430872a0ea inCloud FALSE
#> 33: e23cab430872a0ea elapsedTimeDigest 0.001191616 secs
#> 34: e23cab430872a0ea preDigest .FUN:881ec847b7161f3c
#> 35: e23cab430872a0ea preDigest max:853b1797f54b229c
#> 36: e23cab430872a0ea preDigest min:c40c00762a0dac94
#> 37: e23cab430872a0ea preDigest n:7eef4eae85fd9229
#> 38: e23cab430872a0ea class numeric
#> 39: e23cab430872a0ea object.size 80
#> 40: e23cab430872a0ea fromDisk FALSE
#> 41: e23cab430872a0ea resultHash
#> 42: e23cab430872a0ea elapsedTimeFirstRun 0.0008862019 secs
#> cacheId tagKey tagValue
#> <char> <char> <char>
#> createdDate
#> <char>
#> 1: 2026-01-08 05:48:53.501001
#> 2: 2026-01-08 05:48:53.501001
#> 3: 2026-01-08 05:48:53.501001
#> 4: 2026-01-08 05:48:53.501001
#> 5: 2026-01-08 05:48:53.501001
#> 6: 2026-01-08 05:48:53.501001
#> 7: 2026-01-08 05:48:53.501001
#> 8: 2026-01-08 05:48:53.501001
#> 9: 2026-01-08 05:48:53.501001
#> 10: 2026-01-08 05:48:53.501001
#> 11: 2026-01-08 05:48:53.501001
#> 12: 2026-01-08 05:48:53.501001
#> 13: 2026-01-08 05:48:53.501001
#> 14: 2026-01-08 05:48:53.501001
#> 15: 2026-01-08 05:48:53.490385
#> 16: 2026-01-08 05:48:53.490385
#> 17: 2026-01-08 05:48:53.490385
#> 18: 2026-01-08 05:48:53.490385
#> 19: 2026-01-08 05:48:53.490385
#> 20: 2026-01-08 05:48:53.490385
#> 21: 2026-01-08 05:48:53.490385
#> 22: 2026-01-08 05:48:53.490385
#> 23: 2026-01-08 05:48:53.490385
#> 24: 2026-01-08 05:48:53.490385
#> 25: 2026-01-08 05:48:53.490385
#> 26: 2026-01-08 05:48:53.490385
#> 27: 2026-01-08 05:48:53.490385
#> 28: 2026-01-08 05:48:53.490385
#> 29: 2026-01-08 05:48:53.495731
#> 30: 2026-01-08 05:48:53.495731
#> 31: 2026-01-08 05:48:53.495731
#> 32: 2026-01-08 05:48:53.495731
#> 33: 2026-01-08 05:48:53.495731
#> 34: 2026-01-08 05:48:53.495731
#> 35: 2026-01-08 05:48:53.495731
#> 36: 2026-01-08 05:48:53.495731
#> 37: 2026-01-08 05:48:53.495731
#> 38: 2026-01-08 05:48:53.495731
#> 39: 2026-01-08 05:48:53.495731
#> 40: 2026-01-08 05:48:53.495731
#> 41: 2026-01-08 05:48:53.495731
#> 42: 2026-01-08 05:48:53.495731
#> createdDate
#> <char>
showCache(tmpDir, userTags = c("^a$")) # regular expression ... "a" exactly
#> Cache size:
#> Total (including Rasters): 20 bytes
#> Selected objects (not including Rasters): 20 bytes
#> cacheId tagKey tagValue
#> <char> <char> <char>
#> 1: adf21923cd1e50d0 function rnorm
#> 2: adf21923cd1e50d0 objectName a
#> 3: adf21923cd1e50d0 accessed 2026-01-08 05:48:53.48864
#> 4: adf21923cd1e50d0 inCloud FALSE
#> 5: adf21923cd1e50d0 elapsedTimeDigest 0.001293659 secs
#> 6: adf21923cd1e50d0 preDigest .FUN:4f604aa46882b368
#> 7: adf21923cd1e50d0 preDigest mean:c40c00762a0dac94
#> 8: adf21923cd1e50d0 preDigest n:7eef4eae85fd9229
#> 9: adf21923cd1e50d0 preDigest sd:853b1797f54b229c
#> 10: adf21923cd1e50d0 class numeric
#> 11: adf21923cd1e50d0 object.size 80
#> 12: adf21923cd1e50d0 fromDisk FALSE
#> 13: adf21923cd1e50d0 resultHash
#> 14: adf21923cd1e50d0 elapsedTimeFirstRun 0.0009264946 secs
#> createdDate
#> <char>
#> 1: 2026-01-08 05:48:53.490385
#> 2: 2026-01-08 05:48:53.490385
#> 3: 2026-01-08 05:48:53.490385
#> 4: 2026-01-08 05:48:53.490385
#> 5: 2026-01-08 05:48:53.490385
#> 6: 2026-01-08 05:48:53.490385
#> 7: 2026-01-08 05:48:53.490385
#> 8: 2026-01-08 05:48:53.490385
#> 9: 2026-01-08 05:48:53.490385
#> 10: 2026-01-08 05:48:53.490385
#> 11: 2026-01-08 05:48:53.490385
#> 12: 2026-01-08 05:48:53.490385
#> 13: 2026-01-08 05:48:53.490385
#> 14: 2026-01-08 05:48:53.490385
# 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): 112 bytes
#> Selected objects (not including Rasters): 112 bytes
toRemove <- cache1[tagKey == "object.size"][as.numeric(tagValue) > 700]$cacheId
clearCache(tmpDir, userTags = toRemove, ask = FALSE)
#> Cache size:
#> Total (including Rasters): 220 bytes
#> Selected objects (not including Rasters): 220 bytes
cacheAfter <- showCache(tmpDir, userTags = c("runif")) # Only the small one is left
data.table::setDTthreads(2)
tmpDir <- file.path(tempdir(), "reproducible_examples", "Cache")
try(clearCache(tmpDir, ask = FALSE), silent = TRUE) # just to make sure it is clear
Cache(rnorm, 1, cachePath = tmpDir)
#> Saved! Cache file: ca275879d5116967.rds; fn: rnorm
#> [1] 1.440701
#> attr(,".Cache")
#> attr(,".Cache")$newCache
#> [1] TRUE
#>
#> attr(,"tags")
#> [1] "cacheId:ca275879d5116967"
#> attr(,"callInCache")
#> [1] ""
thisTime <- Sys.time()
Cache(rnorm, 2, cachePath = tmpDir)
#> Saved! Cache file: f5ec171f6daa5dba.rds; fn: rnorm
#> [1] 2.007661 -1.109749
#> attr(,".Cache")
#> attr(,".Cache")$newCache
#> [1] TRUE
#>
#> attr(,"tags")
#> [1] "cacheId:f5ec171f6daa5dba"
#> attr(,"callInCache")
#> [1] ""
Cache(rnorm, 3, cachePath = tmpDir)
#> Saved! Cache file: 3d9ea3398a04ddf4.rds; fn: rnorm
#> [1] 1.4824748 -0.5653828 -1.0107131
#> attr(,".Cache")
#> attr(,".Cache")$newCache
#> [1] TRUE
#>
#> attr(,"tags")
#> [1] "cacheId:3d9ea3398a04ddf4"
#> attr(,"callInCache")
#> [1] ""
Cache(rnorm, 4, cachePath = tmpDir)
#> Saved! Cache file: adf21923cd1e50d0.rds; fn: rnorm
#> [1] -0.7653718 -0.7949368 1.3711983 1.8036946
#> attr(,".Cache")
#> attr(,".Cache")$newCache
#> [1] TRUE
#>
#> attr(,"tags")
#> [1] "cacheId:adf21923cd1e50d0"
#> attr(,"callInCache")
#> [1] ""
showCache(x = tmpDir) # shows all 4 entries
#> Cache size:
#> Total (including Rasters): 70 bytes
#> Selected objects (not including Rasters): 70 bytes
#> cacheId tagKey tagValue
#> <char> <char> <char>
#> 1: 3d9ea3398a04ddf4 function rnorm
#> 2: 3d9ea3398a04ddf4 accessed 2026-01-08 05:48:53.57155
#> 3: 3d9ea3398a04ddf4 inCloud FALSE
#> 4: 3d9ea3398a04ddf4 elapsedTimeDigest 0.001229286 secs
#> 5: 3d9ea3398a04ddf4 preDigest .FUN:4f604aa46882b368
#> 6: 3d9ea3398a04ddf4 preDigest mean:c40c00762a0dac94
#> 7: 3d9ea3398a04ddf4 preDigest n:7f12988bd88a0fb8
#> 8: 3d9ea3398a04ddf4 preDigest sd:853b1797f54b229c
#> 9: 3d9ea3398a04ddf4 class numeric
#> 10: 3d9ea3398a04ddf4 object.size 80
#> 11: 3d9ea3398a04ddf4 fromDisk FALSE
#> 12: 3d9ea3398a04ddf4 resultHash
#> 13: 3d9ea3398a04ddf4 elapsedTimeFirstRun 0.0008006096 secs
#> 14: adf21923cd1e50d0 function rnorm
#> 15: adf21923cd1e50d0 accessed 2026-01-08 05:48:53.57689
#> 16: adf21923cd1e50d0 inCloud FALSE
#> 17: adf21923cd1e50d0 elapsedTimeDigest 0.001190424 secs
#> 18: adf21923cd1e50d0 preDigest .FUN:4f604aa46882b368
#> 19: adf21923cd1e50d0 preDigest mean:c40c00762a0dac94
#> 20: adf21923cd1e50d0 preDigest n:7eef4eae85fd9229
#> 21: adf21923cd1e50d0 preDigest sd:853b1797f54b229c
#> 22: adf21923cd1e50d0 class numeric
#> 23: adf21923cd1e50d0 object.size 80
#> 24: adf21923cd1e50d0 fromDisk FALSE
#> 25: adf21923cd1e50d0 resultHash
#> 26: adf21923cd1e50d0 elapsedTimeFirstRun 0.0008170605 secs
#> 27: ca275879d5116967 function rnorm
#> 28: ca275879d5116967 accessed 2026-01-08 05:48:53.55999
#> 29: ca275879d5116967 inCloud FALSE
#> 30: ca275879d5116967 elapsedTimeDigest 0.001377583 secs
#> 31: ca275879d5116967 preDigest .FUN:4f604aa46882b368
#> 32: ca275879d5116967 preDigest mean:c40c00762a0dac94
#> 33: ca275879d5116967 preDigest n:853b1797f54b229c
#> 34: ca275879d5116967 preDigest sd:853b1797f54b229c
#> 35: ca275879d5116967 class numeric
#> 36: ca275879d5116967 object.size 56
#> 37: ca275879d5116967 fromDisk FALSE
#> 38: ca275879d5116967 resultHash
#> 39: ca275879d5116967 elapsedTimeFirstRun 0.0009548664 secs
#> 40: f5ec171f6daa5dba function rnorm
#> 41: f5ec171f6daa5dba accessed 2026-01-08 05:48:53.56614
#> 42: f5ec171f6daa5dba inCloud FALSE
#> 43: f5ec171f6daa5dba elapsedTimeDigest 0.001232862 secs
#> 44: f5ec171f6daa5dba preDigest .FUN:4f604aa46882b368
#> 45: f5ec171f6daa5dba preDigest mean:c40c00762a0dac94
#> 46: f5ec171f6daa5dba preDigest n:82dc709f2b91918a
#> 47: f5ec171f6daa5dba preDigest sd:853b1797f54b229c
#> 48: f5ec171f6daa5dba class numeric
#> 49: f5ec171f6daa5dba object.size 64
#> 50: f5ec171f6daa5dba fromDisk FALSE
#> 51: f5ec171f6daa5dba resultHash
#> 52: f5ec171f6daa5dba elapsedTimeFirstRun 0.0008497238 secs
#> cacheId tagKey tagValue
#> <char> <char> <char>
#> createdDate
#> <char>
#> 1: 2026-01-08 05:48:53.573205
#> 2: 2026-01-08 05:48:53.573205
#> 3: 2026-01-08 05:48:53.573205
#> 4: 2026-01-08 05:48:53.573205
#> 5: 2026-01-08 05:48:53.573205
#> 6: 2026-01-08 05:48:53.573205
#> 7: 2026-01-08 05:48:53.573205
#> 8: 2026-01-08 05:48:53.573205
#> 9: 2026-01-08 05:48:53.573205
#> 10: 2026-01-08 05:48:53.573205
#> 11: 2026-01-08 05:48:53.573205
#> 12: 2026-01-08 05:48:53.573205
#> 13: 2026-01-08 05:48:53.573205
#> 14: 2026-01-08 05:48:53.578563
#> 15: 2026-01-08 05:48:53.578563
#> 16: 2026-01-08 05:48:53.578563
#> 17: 2026-01-08 05:48:53.578563
#> 18: 2026-01-08 05:48:53.578563
#> 19: 2026-01-08 05:48:53.578563
#> 20: 2026-01-08 05:48:53.578563
#> 21: 2026-01-08 05:48:53.578563
#> 22: 2026-01-08 05:48:53.578563
#> 23: 2026-01-08 05:48:53.578563
#> 24: 2026-01-08 05:48:53.578563
#> 25: 2026-01-08 05:48:53.578563
#> 26: 2026-01-08 05:48:53.578563
#> 27: 2026-01-08 05:48:53.561878
#> 28: 2026-01-08 05:48:53.561878
#> 29: 2026-01-08 05:48:53.561878
#> 30: 2026-01-08 05:48:53.561878
#> 31: 2026-01-08 05:48:53.561878
#> 32: 2026-01-08 05:48:53.561878
#> 33: 2026-01-08 05:48:53.561878
#> 34: 2026-01-08 05:48:53.561878
#> 35: 2026-01-08 05:48:53.561878
#> 36: 2026-01-08 05:48:53.561878
#> 37: 2026-01-08 05:48:53.561878
#> 38: 2026-01-08 05:48:53.561878
#> 39: 2026-01-08 05:48:53.561878
#> 40: 2026-01-08 05:48:53.567863
#> 41: 2026-01-08 05:48:53.567863
#> 42: 2026-01-08 05:48:53.567863
#> 43: 2026-01-08 05:48:53.567863
#> 44: 2026-01-08 05:48:53.567863
#> 45: 2026-01-08 05:48:53.567863
#> 46: 2026-01-08 05:48:53.567863
#> 47: 2026-01-08 05:48:53.567863
#> 48: 2026-01-08 05:48:53.567863
#> 49: 2026-01-08 05:48:53.567863
#> 50: 2026-01-08 05:48:53.567863
#> 51: 2026-01-08 05:48:53.567863
#> 52: 2026-01-08 05:48:53.567863
#> createdDate
#> <char>
cc(ask = FALSE, x = tmpDir)
#> No time provided; removing the most recent entry to the Cache
#> Cache size:
#> Total (including Rasters): 20 bytes
#> Selected objects (not including Rasters): 20 bytes
showCache(x = tmpDir) # most recent is gone
#> Cache size:
#> Total (including Rasters): 50 bytes
#> Selected objects (not including Rasters): 50 bytes
#> cacheId tagKey tagValue
#> <char> <char> <char>
#> 1: 3d9ea3398a04ddf4 function rnorm
#> 2: 3d9ea3398a04ddf4 accessed 2026-01-08 05:48:53.57155
#> 3: 3d9ea3398a04ddf4 inCloud FALSE
#> 4: 3d9ea3398a04ddf4 elapsedTimeDigest 0.001229286 secs
#> 5: 3d9ea3398a04ddf4 preDigest .FUN:4f604aa46882b368
#> 6: 3d9ea3398a04ddf4 preDigest mean:c40c00762a0dac94
#> 7: 3d9ea3398a04ddf4 preDigest n:7f12988bd88a0fb8
#> 8: 3d9ea3398a04ddf4 preDigest sd:853b1797f54b229c
#> 9: 3d9ea3398a04ddf4 class numeric
#> 10: 3d9ea3398a04ddf4 object.size 80
#> 11: 3d9ea3398a04ddf4 fromDisk FALSE
#> 12: 3d9ea3398a04ddf4 resultHash
#> 13: 3d9ea3398a04ddf4 elapsedTimeFirstRun 0.0008006096 secs
#> 14: ca275879d5116967 function rnorm
#> 15: ca275879d5116967 accessed 2026-01-08 05:48:53.55999
#> 16: ca275879d5116967 inCloud FALSE
#> 17: ca275879d5116967 elapsedTimeDigest 0.001377583 secs
#> 18: ca275879d5116967 preDigest .FUN:4f604aa46882b368
#> 19: ca275879d5116967 preDigest mean:c40c00762a0dac94
#> 20: ca275879d5116967 preDigest n:853b1797f54b229c
#> 21: ca275879d5116967 preDigest sd:853b1797f54b229c
#> 22: ca275879d5116967 class numeric
#> 23: ca275879d5116967 object.size 56
#> 24: ca275879d5116967 fromDisk FALSE
#> 25: ca275879d5116967 resultHash
#> 26: ca275879d5116967 elapsedTimeFirstRun 0.0009548664 secs
#> 27: f5ec171f6daa5dba function rnorm
#> 28: f5ec171f6daa5dba accessed 2026-01-08 05:48:53.56614
#> 29: f5ec171f6daa5dba inCloud FALSE
#> 30: f5ec171f6daa5dba elapsedTimeDigest 0.001232862 secs
#> 31: f5ec171f6daa5dba preDigest .FUN:4f604aa46882b368
#> 32: f5ec171f6daa5dba preDigest mean:c40c00762a0dac94
#> 33: f5ec171f6daa5dba preDigest n:82dc709f2b91918a
#> 34: f5ec171f6daa5dba preDigest sd:853b1797f54b229c
#> 35: f5ec171f6daa5dba class numeric
#> 36: f5ec171f6daa5dba object.size 64
#> 37: f5ec171f6daa5dba fromDisk FALSE
#> 38: f5ec171f6daa5dba resultHash
#> 39: f5ec171f6daa5dba elapsedTimeFirstRun 0.0008497238 secs
#> cacheId tagKey tagValue
#> <char> <char> <char>
#> createdDate
#> <char>
#> 1: 2026-01-08 05:48:53.573205
#> 2: 2026-01-08 05:48:53.573205
#> 3: 2026-01-08 05:48:53.573205
#> 4: 2026-01-08 05:48:53.573205
#> 5: 2026-01-08 05:48:53.573205
#> 6: 2026-01-08 05:48:53.573205
#> 7: 2026-01-08 05:48:53.573205
#> 8: 2026-01-08 05:48:53.573205
#> 9: 2026-01-08 05:48:53.573205
#> 10: 2026-01-08 05:48:53.573205
#> 11: 2026-01-08 05:48:53.573205
#> 12: 2026-01-08 05:48:53.573205
#> 13: 2026-01-08 05:48:53.573205
#> 14: 2026-01-08 05:48:53.561878
#> 15: 2026-01-08 05:48:53.561878
#> 16: 2026-01-08 05:48:53.561878
#> 17: 2026-01-08 05:48:53.561878
#> 18: 2026-01-08 05:48:53.561878
#> 19: 2026-01-08 05:48:53.561878
#> 20: 2026-01-08 05:48:53.561878
#> 21: 2026-01-08 05:48:53.561878
#> 22: 2026-01-08 05:48:53.561878
#> 23: 2026-01-08 05:48:53.561878
#> 24: 2026-01-08 05:48:53.561878
#> 25: 2026-01-08 05:48:53.561878
#> 26: 2026-01-08 05:48:53.561878
#> 27: 2026-01-08 05:48:53.567863
#> 28: 2026-01-08 05:48:53.567863
#> 29: 2026-01-08 05:48:53.567863
#> 30: 2026-01-08 05:48:53.567863
#> 31: 2026-01-08 05:48:53.567863
#> 32: 2026-01-08 05:48:53.567863
#> 33: 2026-01-08 05:48:53.567863
#> 34: 2026-01-08 05:48:53.567863
#> 35: 2026-01-08 05:48:53.567863
#> 36: 2026-01-08 05:48:53.567863
#> 37: 2026-01-08 05:48:53.567863
#> 38: 2026-01-08 05:48:53.567863
#> 39: 2026-01-08 05:48:53.567863
#> createdDate
#> <char>
cc(thisTime, ask = FALSE, x = tmpDir)
#> Cache size:
#> Total (including Rasters): 36 bytes
#> Selected objects (not including Rasters): 36 bytes
showCache(x = tmpDir) # all those after thisTime gone, i.e., only 1 left
#> Cache size:
#> Total (including Rasters): 14 bytes
#> Selected objects (not including Rasters): 14 bytes
#> cacheId tagKey tagValue
#> <char> <char> <char>
#> 1: ca275879d5116967 function rnorm
#> 2: ca275879d5116967 accessed 2026-01-08 05:48:53.55999
#> 3: ca275879d5116967 inCloud FALSE
#> 4: ca275879d5116967 elapsedTimeDigest 0.001377583 secs
#> 5: ca275879d5116967 preDigest .FUN:4f604aa46882b368
#> 6: ca275879d5116967 preDigest mean:c40c00762a0dac94
#> 7: ca275879d5116967 preDigest n:853b1797f54b229c
#> 8: ca275879d5116967 preDigest sd:853b1797f54b229c
#> 9: ca275879d5116967 class numeric
#> 10: ca275879d5116967 object.size 56
#> 11: ca275879d5116967 fromDisk FALSE
#> 12: ca275879d5116967 resultHash
#> 13: ca275879d5116967 elapsedTimeFirstRun 0.0009548664 secs
#> createdDate
#> <char>
#> 1: 2026-01-08 05:48:53.561878
#> 2: 2026-01-08 05:48:53.561878
#> 3: 2026-01-08 05:48:53.561878
#> 4: 2026-01-08 05:48:53.561878
#> 5: 2026-01-08 05:48:53.561878
#> 6: 2026-01-08 05:48:53.561878
#> 7: 2026-01-08 05:48:53.561878
#> 8: 2026-01-08 05:48:53.561878
#> 9: 2026-01-08 05:48:53.561878
#> 10: 2026-01-08 05:48:53.561878
#> 11: 2026-01-08 05:48:53.561878
#> 12: 2026-01-08 05:48:53.561878
#> 13: 2026-01-08 05:48:53.561878
cc(ask = FALSE, x = tmpDir) # Cache is
#> No time provided; removing the most recent entry to the Cache
#> Cache size:
#> Total (including Rasters): 14 bytes
#> Selected objects (not including Rasters): 14 bytes
cc(ask = FALSE, x = tmpDir) # Cache is already empty
#> No time provided; removing the most recent entry to the Cache
#> Cache already empty