Introduction to Cache

Eliot J. B. McIntire

September 11 2019

1 Reproducible workflow

As part of a reproducible workflow, caching of function calls, code chunks, and other elements of a project is a critical component. The objective of a reproducible workflow is is likely that an entire work flow from raw data to publication, decision support, report writing, presentation building etc., could be built and be reproducible anywhere, on any computer, operating system, with any starting conditions, on demand. The reproducible::Cache function is built to work with any R function.

1.1 Differences with other approaches

Cache uses 2 key the archivist functions saveToLocalRepo and loadFromLocalRepo, but does not use archivist::cache. Similar to archivist::cache, there is some reliance on digest::digest to determine whether the arguments are identical in subsequent iterations. It also but does many things that make standard caching with digest::digest don’t work reliably between systems. For these, the function .robustDigest is introduced to make caching transferable between systems. This is relevant for file paths, environments, parallel clusters, functions (which are contained within an environment), and many others (e.g., see ?.robustDigest for methods). Cache also adds important elements like automated tagging and the option to retrieve disk-cached values via stashed objects in memory using memoise::memoise. This means that running Cache 1, 2, and 3 times on the same function will get progressively faster. This can be extremely useful for web apps built with, say shiny.

1.2 Function-level caching

Any function can be cached using: Cache(FUN = functionName, ...).

This will be a slight change to a function call, such as: projectRaster(raster, crs = crs(newRaster)) to Cache(projectRaster, raster, crs = crs(newRaster)).

This is particularly useful for expensive operations.

## Loading required package: sp
## Registered S3 method overwritten by 'R.oo':
##   method        from       
##   throw.default R.methodsS3
## [1] "/tmp/RtmpxsEeYG/reproducible_examples/Cache"
##    user  system elapsed 
##   2.599   0.198   2.802
##    user  system elapsed 
##   2.603   0.207   2.883
##   ...(Object to retrieve is large: 6.5 Mb)
##   loading cached result from previous projectRaster call, adding to memoised copy
##    user  system elapsed 
##   0.266   0.001   0.267
##   ...(Object to retrieve is large: 6.5 Mb)
##   loading memoised result from previous projectRaster call.
##    user  system elapsed 
##   0.023   0.003   0.025
## [1] TRUE
## [1] TRUE

1.3 Caching examples

1.4 Example 1: Basic cache use with tags

## Cache size:
##   Total (including Rasters): 1 Kb
##   Selected objects (not including Rasters): 504 bytes
##                             artifact         tagKey
##  1: 556f10b59bc597674d0d99e71904b815         format
##  2: 556f10b59bc597674d0d99e71904b815           name
##  3: 556f10b59bc597674d0d99e71904b815          class
##  4: 556f10b59bc597674d0d99e71904b815           date
##  5: 556f10b59bc597674d0d99e71904b815        cacheId
##  6: 556f10b59bc597674d0d99e71904b815     objectName
##  7: 556f10b59bc597674d0d99e71904b815       function
##  8: 556f10b59bc597674d0d99e71904b815    object.size
##  9: 556f10b59bc597674d0d99e71904b815       accessed
## 10: 556f10b59bc597674d0d99e71904b815 otherFunctions
## 11: 556f10b59bc597674d0d99e71904b815 otherFunctions
## 12: 556f10b59bc597674d0d99e71904b815 otherFunctions
## 13: 556f10b59bc597674d0d99e71904b815 otherFunctions
## 14: 556f10b59bc597674d0d99e71904b815 otherFunctions
## 15: 556f10b59bc597674d0d99e71904b815 otherFunctions
## 16: 556f10b59bc597674d0d99e71904b815 otherFunctions
## 17: 556f10b59bc597674d0d99e71904b815 otherFunctions
## 18: 556f10b59bc597674d0d99e71904b815 otherFunctions
## 19: 556f10b59bc597674d0d99e71904b815 otherFunctions
## 20: 556f10b59bc597674d0d99e71904b815      preDigest
## 21: 556f10b59bc597674d0d99e71904b815      preDigest
## 22: da8e4922325e7e672fe049890dafc18b         format
## 23: da8e4922325e7e672fe049890dafc18b           name
## 24: da8e4922325e7e672fe049890dafc18b          class
## 25: da8e4922325e7e672fe049890dafc18b           date
## 26: da8e4922325e7e672fe049890dafc18b        cacheId
## 27: da8e4922325e7e672fe049890dafc18b     objectName
## 28: da8e4922325e7e672fe049890dafc18b       function
## 29: da8e4922325e7e672fe049890dafc18b    object.size
## 30: da8e4922325e7e672fe049890dafc18b       accessed
## 31: da8e4922325e7e672fe049890dafc18b otherFunctions
## 32: da8e4922325e7e672fe049890dafc18b otherFunctions
## 33: da8e4922325e7e672fe049890dafc18b otherFunctions
## 34: da8e4922325e7e672fe049890dafc18b otherFunctions
## 35: da8e4922325e7e672fe049890dafc18b otherFunctions
## 36: da8e4922325e7e672fe049890dafc18b otherFunctions
## 37: da8e4922325e7e672fe049890dafc18b otherFunctions
## 38: da8e4922325e7e672fe049890dafc18b otherFunctions
## 39: da8e4922325e7e672fe049890dafc18b otherFunctions
## 40: da8e4922325e7e672fe049890dafc18b otherFunctions
## 41: da8e4922325e7e672fe049890dafc18b      preDigest
## 42: da8e4922325e7e672fe049890dafc18b      preDigest
##                             artifact         tagKey
##                             tagValue         createdDate
##  1:                              rda 2019-09-11 13:06:11
##  2: 556f10b59bc597674d0d99e71904b815 2019-09-11 13:06:11
##  3:                          numeric 2019-09-11 13:06:11
##  4:              2019-09-11 13:06:11 2019-09-11 13:06:11
##  5:                 3aef38d1fc02aee5 2019-09-11 13:06:11
##  6:                                b 2019-09-11 13:06:11
##  7:                            runif 2019-09-11 13:06:11
##  8:                             1008 2019-09-11 13:06:11
##  9:              2019-09-11 13:06:11 2019-09-11 13:06:11
## 10:                 vweave_rmarkdown 2019-09-11 13:06:11
## 11:                     process_file 2019-09-11 13:06:11
## 12:                    process_group 2019-09-11 13:06:11
## 13:              process_group.block 2019-09-11 13:06:11
## 14:                       call_block 2019-09-11 13:06:11
## 15:                       block_exec 2019-09-11 13:06:11
## 16:                           in_dir 2019-09-11 13:06:11
## 17:                        timing_fn 2019-09-11 13:06:11
## 18:                           handle 2019-09-11 13:06:11
## 19:                      withVisible 2019-09-11 13:06:11
## 20:               n:7eef4eae85fd9229 2019-09-11 13:06:11
## 21:            .FUN:881ec847b7161f3c 2019-09-11 13:06:11
## 22:                              rda 2019-09-11 13:06:11
## 23: da8e4922325e7e672fe049890dafc18b 2019-09-11 13:06:11
## 24:                          numeric 2019-09-11 13:06:11
## 25:              2019-09-11 13:06:11 2019-09-11 13:06:11
## 26:                 f7bee22047b8d0c1 2019-09-11 13:06:11
## 27:                                a 2019-09-11 13:06:11
## 28:                            rnorm 2019-09-11 13:06:11
## 29:                             1008 2019-09-11 13:06:11
## 30:              2019-09-11 13:06:11 2019-09-11 13:06:11
## 31:                 vweave_rmarkdown 2019-09-11 13:06:11
## 32:                     process_file 2019-09-11 13:06:11
## 33:                    process_group 2019-09-11 13:06:11
## 34:              process_group.block 2019-09-11 13:06:11
## 35:                       call_block 2019-09-11 13:06:11
## 36:                       block_exec 2019-09-11 13:06:11
## 37:                           in_dir 2019-09-11 13:06:11
## 38:                        timing_fn 2019-09-11 13:06:11
## 39:                           handle 2019-09-11 13:06:11
## 40:                      withVisible 2019-09-11 13:06:11
## 41:               n:7eef4eae85fd9229 2019-09-11 13:06:11
## 42:            .FUN:4f604aa46882b368 2019-09-11 13:06:11
##                             tagValue         createdDate
## Cache size:
##   Total (including Rasters): 1 Kb
##   Selected objects (not including Rasters): 252 bytes
##                             artifact         tagKey
##  1: da8e4922325e7e672fe049890dafc18b         format
##  2: da8e4922325e7e672fe049890dafc18b           name
##  3: da8e4922325e7e672fe049890dafc18b          class
##  4: da8e4922325e7e672fe049890dafc18b           date
##  5: da8e4922325e7e672fe049890dafc18b        cacheId
##  6: da8e4922325e7e672fe049890dafc18b     objectName
##  7: da8e4922325e7e672fe049890dafc18b       function
##  8: da8e4922325e7e672fe049890dafc18b    object.size
##  9: da8e4922325e7e672fe049890dafc18b       accessed
## 10: da8e4922325e7e672fe049890dafc18b otherFunctions
## 11: da8e4922325e7e672fe049890dafc18b otherFunctions
## 12: da8e4922325e7e672fe049890dafc18b otherFunctions
## 13: da8e4922325e7e672fe049890dafc18b otherFunctions
## 14: da8e4922325e7e672fe049890dafc18b otherFunctions
## 15: da8e4922325e7e672fe049890dafc18b otherFunctions
## 16: da8e4922325e7e672fe049890dafc18b otherFunctions
## 17: da8e4922325e7e672fe049890dafc18b otherFunctions
## 18: da8e4922325e7e672fe049890dafc18b otherFunctions
## 19: da8e4922325e7e672fe049890dafc18b otherFunctions
## 20: da8e4922325e7e672fe049890dafc18b      preDigest
## 21: da8e4922325e7e672fe049890dafc18b      preDigest
##                             artifact         tagKey
##                             tagValue         createdDate
##  1:                              rda 2019-09-11 13:06:11
##  2: da8e4922325e7e672fe049890dafc18b 2019-09-11 13:06:11
##  3:                          numeric 2019-09-11 13:06:11
##  4:              2019-09-11 13:06:11 2019-09-11 13:06:11
##  5:                 f7bee22047b8d0c1 2019-09-11 13:06:11
##  6:                                a 2019-09-11 13:06:11
##  7:                            rnorm 2019-09-11 13:06:11
##  8:                             1008 2019-09-11 13:06:11
##  9:              2019-09-11 13:06:11 2019-09-11 13:06:11
## 10:                 vweave_rmarkdown 2019-09-11 13:06:11
## 11:                     process_file 2019-09-11 13:06:11
## 12:                    process_group 2019-09-11 13:06:11
## 13:              process_group.block 2019-09-11 13:06:11
## 14:                       call_block 2019-09-11 13:06:11
## 15:                       block_exec 2019-09-11 13:06:11
## 16:                           in_dir 2019-09-11 13:06:11
## 17:                        timing_fn 2019-09-11 13:06:11
## 18:                           handle 2019-09-11 13:06:11
## 19:                      withVisible 2019-09-11 13:06:11
## 20:               n:7eef4eae85fd9229 2019-09-11 13:06:11
## 21:            .FUN:4f604aa46882b368 2019-09-11 13:06:11
##                             tagValue         createdDate
## Cache size:
##   Total (including Rasters): 1 Kb
##   Selected objects (not including Rasters): 252 bytes
##                             artifact         tagKey
##  1: 556f10b59bc597674d0d99e71904b815         format
##  2: 556f10b59bc597674d0d99e71904b815           name
##  3: 556f10b59bc597674d0d99e71904b815          class
##  4: 556f10b59bc597674d0d99e71904b815           date
##  5: 556f10b59bc597674d0d99e71904b815        cacheId
##  6: 556f10b59bc597674d0d99e71904b815     objectName
##  7: 556f10b59bc597674d0d99e71904b815       function
##  8: 556f10b59bc597674d0d99e71904b815    object.size
##  9: 556f10b59bc597674d0d99e71904b815       accessed
## 10: 556f10b59bc597674d0d99e71904b815 otherFunctions
## 11: 556f10b59bc597674d0d99e71904b815 otherFunctions
## 12: 556f10b59bc597674d0d99e71904b815 otherFunctions
## 13: 556f10b59bc597674d0d99e71904b815 otherFunctions
## 14: 556f10b59bc597674d0d99e71904b815 otherFunctions
## 15: 556f10b59bc597674d0d99e71904b815 otherFunctions
## 16: 556f10b59bc597674d0d99e71904b815 otherFunctions
## 17: 556f10b59bc597674d0d99e71904b815 otherFunctions
## 18: 556f10b59bc597674d0d99e71904b815 otherFunctions
## 19: 556f10b59bc597674d0d99e71904b815 otherFunctions
## 20: 556f10b59bc597674d0d99e71904b815      preDigest
## 21: 556f10b59bc597674d0d99e71904b815      preDigest
##                             artifact         tagKey
##                             tagValue         createdDate
##  1:                              rda 2019-09-11 13:06:11
##  2: 556f10b59bc597674d0d99e71904b815 2019-09-11 13:06:11
##  3:                          numeric 2019-09-11 13:06:11
##  4:              2019-09-11 13:06:11 2019-09-11 13:06:11
##  5:                 3aef38d1fc02aee5 2019-09-11 13:06:11
##  6:                                b 2019-09-11 13:06:11
##  7:                            runif 2019-09-11 13:06:11
##  8:                             1008 2019-09-11 13:06:11
##  9:              2019-09-11 13:06:11 2019-09-11 13:06:11
## 10:                 vweave_rmarkdown 2019-09-11 13:06:11
## 11:                     process_file 2019-09-11 13:06:11
## 12:                    process_group 2019-09-11 13:06:11
## 13:              process_group.block 2019-09-11 13:06:11
## 14:                       call_block 2019-09-11 13:06:11
## 15:                       block_exec 2019-09-11 13:06:11
## 16:                           in_dir 2019-09-11 13:06:11
## 17:                        timing_fn 2019-09-11 13:06:11
## 18:                           handle 2019-09-11 13:06:11
## 19:                      withVisible 2019-09-11 13:06:11
## 20:               n:7eef4eae85fd9229 2019-09-11 13:06:11
## 21:            .FUN:881ec847b7161f3c 2019-09-11 13:06:11
##                             tagValue         createdDate
## Cache size:
##   Total (including Rasters): 1 Kb
##   Selected objects (not including Rasters): 252 bytes
## Cache size:
##   Total (including Rasters): 804 bytes
##   Selected objects (not including Rasters): 804 bytes
##                             artifact         tagKey
##  1: 6baf4fda906f87718b95155c0c551fe8         format
##  2: 6baf4fda906f87718b95155c0c551fe8           name
##  3: 6baf4fda906f87718b95155c0c551fe8          class
##  4: 6baf4fda906f87718b95155c0c551fe8           date
##  5: 6baf4fda906f87718b95155c0c551fe8        cacheId
##  6: 6baf4fda906f87718b95155c0c551fe8       function
##  7: 6baf4fda906f87718b95155c0c551fe8    object.size
##  8: 6baf4fda906f87718b95155c0c551fe8       accessed
##  9: 6baf4fda906f87718b95155c0c551fe8 otherFunctions
## 10: 6baf4fda906f87718b95155c0c551fe8 otherFunctions
## 11: 6baf4fda906f87718b95155c0c551fe8 otherFunctions
## 12: 6baf4fda906f87718b95155c0c551fe8 otherFunctions
## 13: 6baf4fda906f87718b95155c0c551fe8 otherFunctions
## 14: 6baf4fda906f87718b95155c0c551fe8 otherFunctions
## 15: 6baf4fda906f87718b95155c0c551fe8 otherFunctions
## 16: 6baf4fda906f87718b95155c0c551fe8 otherFunctions
## 17: 6baf4fda906f87718b95155c0c551fe8 otherFunctions
## 18: 6baf4fda906f87718b95155c0c551fe8 otherFunctions
## 19: 6baf4fda906f87718b95155c0c551fe8      preDigest
## 20: 6baf4fda906f87718b95155c0c551fe8      preDigest
## 21: 6baf4fda906f87718b95155c0c551fe8      preDigest
## 22: 6baf4fda906f87718b95155c0c551fe8       accessed
## 23: 6baf4fda906f87718b95155c0c551fe8       accessed
## 24: 6baf4fda906f87718b95155c0c551fe8       accessed
## 25: 9f06dd6ca53124b444c7edab5588f926         format
## 26: 9f06dd6ca53124b444c7edab5588f926           name
## 27: 9f06dd6ca53124b444c7edab5588f926          class
## 28: 9f06dd6ca53124b444c7edab5588f926           date
## 29: 9f06dd6ca53124b444c7edab5588f926        cacheId
## 30: 9f06dd6ca53124b444c7edab5588f926       function
## 31: 9f06dd6ca53124b444c7edab5588f926    object.size
## 32: 9f06dd6ca53124b444c7edab5588f926       accessed
## 33: 9f06dd6ca53124b444c7edab5588f926 otherFunctions
## 34: 9f06dd6ca53124b444c7edab5588f926 otherFunctions
## 35: 9f06dd6ca53124b444c7edab5588f926 otherFunctions
## 36: 9f06dd6ca53124b444c7edab5588f926 otherFunctions
## 37: 9f06dd6ca53124b444c7edab5588f926 otherFunctions
## 38: 9f06dd6ca53124b444c7edab5588f926 otherFunctions
## 39: 9f06dd6ca53124b444c7edab5588f926 otherFunctions
## 40: 9f06dd6ca53124b444c7edab5588f926 otherFunctions
## 41: 9f06dd6ca53124b444c7edab5588f926 otherFunctions
## 42: 9f06dd6ca53124b444c7edab5588f926 otherFunctions
## 43: 9f06dd6ca53124b444c7edab5588f926 otherFunctions
## 44: 9f06dd6ca53124b444c7edab5588f926 otherFunctions
## 45: 9f06dd6ca53124b444c7edab5588f926      preDigest
## 46: 9f06dd6ca53124b444c7edab5588f926      preDigest
## 47: 9f06dd6ca53124b444c7edab5588f926      preDigest
## 48: da8e4922325e7e672fe049890dafc18b         format
## 49: da8e4922325e7e672fe049890dafc18b           name
## 50: da8e4922325e7e672fe049890dafc18b          class
## 51: da8e4922325e7e672fe049890dafc18b           date
## 52: da8e4922325e7e672fe049890dafc18b        cacheId
## 53: da8e4922325e7e672fe049890dafc18b     objectName
## 54: da8e4922325e7e672fe049890dafc18b       function
## 55: da8e4922325e7e672fe049890dafc18b    object.size
## 56: da8e4922325e7e672fe049890dafc18b       accessed
## 57: da8e4922325e7e672fe049890dafc18b otherFunctions
## 58: da8e4922325e7e672fe049890dafc18b otherFunctions
## 59: da8e4922325e7e672fe049890dafc18b otherFunctions
## 60: da8e4922325e7e672fe049890dafc18b otherFunctions
## 61: da8e4922325e7e672fe049890dafc18b otherFunctions
## 62: da8e4922325e7e672fe049890dafc18b otherFunctions
## 63: da8e4922325e7e672fe049890dafc18b otherFunctions
## 64: da8e4922325e7e672fe049890dafc18b otherFunctions
## 65: da8e4922325e7e672fe049890dafc18b otherFunctions
## 66: da8e4922325e7e672fe049890dafc18b otherFunctions
## 67: da8e4922325e7e672fe049890dafc18b      preDigest
## 68: da8e4922325e7e672fe049890dafc18b      preDigest
##                             artifact         tagKey
##                             tagValue         createdDate
##  1:                              rda 2019-09-11 13:06:11
##  2: 6baf4fda906f87718b95155c0c551fe8 2019-09-11 13:06:11
##  3:                          numeric 2019-09-11 13:06:11
##  4:              2019-09-11 13:06:11 2019-09-11 13:06:11
##  5:                 f11fb1a2880f8060 2019-09-11 13:06:11
##  6:                            rnorm 2019-09-11 13:06:11
##  7:                             1104 2019-09-11 13:06:11
##  8:              2019-09-11 13:06:11 2019-09-11 13:06:11
##  9:                 vweave_rmarkdown 2019-09-11 13:06:11
## 10:                     process_file 2019-09-11 13:06:11
## 11:                    process_group 2019-09-11 13:06:11
## 12:              process_group.block 2019-09-11 13:06:11
## 13:                       call_block 2019-09-11 13:06:11
## 14:                       block_exec 2019-09-11 13:06:11
## 15:                           in_dir 2019-09-11 13:06:11
## 16:                        timing_fn 2019-09-11 13:06:11
## 17:                           handle 2019-09-11 13:06:11
## 18:                      withVisible 2019-09-11 13:06:11
## 19:               n:c5775c3b366fb719 2019-09-11 13:06:11
## 20:            mean:15620f138033a66c 2019-09-11 13:06:11
## 21:            .FUN:4f604aa46882b368 2019-09-11 13:06:11
## 22:              2019-09-11 13:06:11 2019-09-11 13:06:11
## 23:              2019-09-11 13:06:11 2019-09-11 13:06:11
## 24:              2019-09-11 13:06:11 2019-09-11 13:06:11
## 25:                              rda 2019-09-11 13:06:11
## 26: 9f06dd6ca53124b444c7edab5588f926 2019-09-11 13:06:11
## 27:                          numeric 2019-09-11 13:06:11
## 28:              2019-09-11 13:06:11 2019-09-11 13:06:11
## 29:                 c16f0e2c57596069 2019-09-11 13:06:11
## 30:              rnorm pipe sequence 2019-09-11 13:06:11
## 31:                             1104 2019-09-11 13:06:11
## 32:              2019-09-11 13:06:11 2019-09-11 13:06:11
## 33:                 vweave_rmarkdown 2019-09-11 13:06:11
## 34:                     process_file 2019-09-11 13:06:11
## 35:                    process_group 2019-09-11 13:06:11
## 36:              process_group.block 2019-09-11 13:06:11
## 37:                       call_block 2019-09-11 13:06:11
## 38:                       block_exec 2019-09-11 13:06:11
## 39:                           in_dir 2019-09-11 13:06:11
## 40:                        timing_fn 2019-09-11 13:06:11
## 41:                           handle 2019-09-11 13:06:11
## 42:                      withVisible 2019-09-11 13:06:11
## 43:                              %C% 2019-09-11 13:06:11
## 44:                          do.call 2019-09-11 13:06:11
## 45:               n:c5775c3b366fb719 2019-09-11 13:06:11
## 46:            mean:152602b8ff81e5bb 2019-09-11 13:06:11
## 47:            .FUN:4f604aa46882b368 2019-09-11 13:06:11
## 48:                              rda 2019-09-11 13:06:11
## 49: da8e4922325e7e672fe049890dafc18b 2019-09-11 13:06:11
## 50:                          numeric 2019-09-11 13:06:11
## 51:              2019-09-11 13:06:11 2019-09-11 13:06:11
## 52:                 f7bee22047b8d0c1 2019-09-11 13:06:11
## 53:                                a 2019-09-11 13:06:11
## 54:                            rnorm 2019-09-11 13:06:11
## 55:                             1008 2019-09-11 13:06:11
## 56:              2019-09-11 13:06:11 2019-09-11 13:06:11
## 57:                 vweave_rmarkdown 2019-09-11 13:06:11
## 58:                     process_file 2019-09-11 13:06:11
## 59:                    process_group 2019-09-11 13:06:11
## 60:              process_group.block 2019-09-11 13:06:11
## 61:                       call_block 2019-09-11 13:06:11
## 62:                       block_exec 2019-09-11 13:06:11
## 63:                           in_dir 2019-09-11 13:06:11
## 64:                        timing_fn 2019-09-11 13:06:11
## 65:                           handle 2019-09-11 13:06:11
## 66:                      withVisible 2019-09-11 13:06:11
## 67:               n:7eef4eae85fd9229 2019-09-11 13:06:11
## 68:            .FUN:4f604aa46882b368 2019-09-11 13:06:11
##                             tagValue         createdDate

1.5 Example 2: using the “accessed” tag

##   loading cached result from previous rnorm call, adding to memoised copy
## Cache size:
##   Total (including Rasters): 504 bytes
##   Selected objects (not including Rasters): 504 bytes
## Cache size:
##   Total (including Rasters): 504 bytes
##   Selected objects (not including Rasters): 504 bytes
## Cache size:
##   Total (including Rasters): 504 bytes
##   Selected objects (not including Rasters): 504 bytes
## Cache size:
##   Total (including Rasters): 0 bytes
##   Selected objects (not including Rasters): 0 bytes
## Empty data.table (0 rows and 3 cols): md5hash,name,createdDate

1.6 Example 3: using keepCache

## Cache size:
##   Total (including Rasters): 504 bytes
##   Selected objects (not including Rasters): 504 bytes
##                             artifact         tagKey
##  1: 92dfc041c09e3480875a66d26b479943         format
##  2: 92dfc041c09e3480875a66d26b479943           name
##  3: 92dfc041c09e3480875a66d26b479943          class
##  4: 92dfc041c09e3480875a66d26b479943           date
##  5: 92dfc041c09e3480875a66d26b479943        cacheId
##  6: 92dfc041c09e3480875a66d26b479943     objectName
##  7: 92dfc041c09e3480875a66d26b479943       function
##  8: 92dfc041c09e3480875a66d26b479943    object.size
##  9: 92dfc041c09e3480875a66d26b479943       accessed
## 10: 92dfc041c09e3480875a66d26b479943 otherFunctions
## 11: 92dfc041c09e3480875a66d26b479943 otherFunctions
## 12: 92dfc041c09e3480875a66d26b479943 otherFunctions
## 13: 92dfc041c09e3480875a66d26b479943 otherFunctions
## 14: 92dfc041c09e3480875a66d26b479943 otherFunctions
## 15: 92dfc041c09e3480875a66d26b479943 otherFunctions
## 16: 92dfc041c09e3480875a66d26b479943 otherFunctions
## 17: 92dfc041c09e3480875a66d26b479943 otherFunctions
## 18: 92dfc041c09e3480875a66d26b479943 otherFunctions
## 19: 92dfc041c09e3480875a66d26b479943 otherFunctions
## 20: 92dfc041c09e3480875a66d26b479943      preDigest
## 21: 92dfc041c09e3480875a66d26b479943      preDigest
## 22: deb774406e1a36c71f4814eec81c9ee7         format
## 23: deb774406e1a36c71f4814eec81c9ee7           name
## 24: deb774406e1a36c71f4814eec81c9ee7          class
## 25: deb774406e1a36c71f4814eec81c9ee7           date
## 26: deb774406e1a36c71f4814eec81c9ee7        cacheId
## 27: deb774406e1a36c71f4814eec81c9ee7     objectName
## 28: deb774406e1a36c71f4814eec81c9ee7       function
## 29: deb774406e1a36c71f4814eec81c9ee7    object.size
## 30: deb774406e1a36c71f4814eec81c9ee7       accessed
## 31: deb774406e1a36c71f4814eec81c9ee7 otherFunctions
## 32: deb774406e1a36c71f4814eec81c9ee7 otherFunctions
## 33: deb774406e1a36c71f4814eec81c9ee7 otherFunctions
## 34: deb774406e1a36c71f4814eec81c9ee7 otherFunctions
## 35: deb774406e1a36c71f4814eec81c9ee7 otherFunctions
## 36: deb774406e1a36c71f4814eec81c9ee7 otherFunctions
## 37: deb774406e1a36c71f4814eec81c9ee7 otherFunctions
## 38: deb774406e1a36c71f4814eec81c9ee7 otherFunctions
## 39: deb774406e1a36c71f4814eec81c9ee7 otherFunctions
## 40: deb774406e1a36c71f4814eec81c9ee7 otherFunctions
## 41: deb774406e1a36c71f4814eec81c9ee7      preDigest
## 42: deb774406e1a36c71f4814eec81c9ee7      preDigest
##                             artifact         tagKey
##                             tagValue         createdDate
##  1:                              rda 2019-09-11 13:06:12
##  2: 92dfc041c09e3480875a66d26b479943 2019-09-11 13:06:12
##  3:                          numeric 2019-09-11 13:06:12
##  4:              2019-09-11 13:06:12 2019-09-11 13:06:12
##  5:                 3aef38d1fc02aee5 2019-09-11 13:06:12
##  6:                                b 2019-09-11 13:06:12
##  7:                            runif 2019-09-11 13:06:12
##  8:                             1008 2019-09-11 13:06:12
##  9:              2019-09-11 13:06:12 2019-09-11 13:06:12
## 10:                 vweave_rmarkdown 2019-09-11 13:06:12
## 11:                     process_file 2019-09-11 13:06:12
## 12:                    process_group 2019-09-11 13:06:12
## 13:              process_group.block 2019-09-11 13:06:12
## 14:                       call_block 2019-09-11 13:06:12
## 15:                       block_exec 2019-09-11 13:06:12
## 16:                           in_dir 2019-09-11 13:06:12
## 17:                        timing_fn 2019-09-11 13:06:12
## 18:                           handle 2019-09-11 13:06:12
## 19:                      withVisible 2019-09-11 13:06:12
## 20:               n:7eef4eae85fd9229 2019-09-11 13:06:12
## 21:            .FUN:881ec847b7161f3c 2019-09-11 13:06:12
## 22:                              rda 2019-09-11 13:06:12
## 23: deb774406e1a36c71f4814eec81c9ee7 2019-09-11 13:06:12
## 24:                          numeric 2019-09-11 13:06:12
## 25:              2019-09-11 13:06:12 2019-09-11 13:06:12
## 26:                 f7bee22047b8d0c1 2019-09-11 13:06:12
## 27:                                a 2019-09-11 13:06:12
## 28:                            rnorm 2019-09-11 13:06:12
## 29:                             1008 2019-09-11 13:06:12
## 30:              2019-09-11 13:06:12 2019-09-11 13:06:12
## 31:                 vweave_rmarkdown 2019-09-11 13:06:12
## 32:                     process_file 2019-09-11 13:06:12
## 33:                    process_group 2019-09-11 13:06:12
## 34:              process_group.block 2019-09-11 13:06:12
## 35:                       call_block 2019-09-11 13:06:12
## 36:                       block_exec 2019-09-11 13:06:12
## 37:                           in_dir 2019-09-11 13:06:12
## 38:                        timing_fn 2019-09-11 13:06:12
## 39:                           handle 2019-09-11 13:06:12
## 40:                      withVisible 2019-09-11 13:06:12
## 41:               n:7eef4eae85fd9229 2019-09-11 13:06:12
## 42:            .FUN:4f604aa46882b368 2019-09-11 13:06:12
##                             tagValue         createdDate
## Cache size:
##   Total (including Rasters): 504 bytes
##   Selected objects (not including Rasters): 252 bytes
##                             artifact         tagKey
##  1: deb774406e1a36c71f4814eec81c9ee7         format
##  2: deb774406e1a36c71f4814eec81c9ee7           name
##  3: deb774406e1a36c71f4814eec81c9ee7          class
##  4: deb774406e1a36c71f4814eec81c9ee7           date
##  5: deb774406e1a36c71f4814eec81c9ee7        cacheId
##  6: deb774406e1a36c71f4814eec81c9ee7     objectName
##  7: deb774406e1a36c71f4814eec81c9ee7       function
##  8: deb774406e1a36c71f4814eec81c9ee7    object.size
##  9: deb774406e1a36c71f4814eec81c9ee7       accessed
## 10: deb774406e1a36c71f4814eec81c9ee7 otherFunctions
## 11: deb774406e1a36c71f4814eec81c9ee7 otherFunctions
## 12: deb774406e1a36c71f4814eec81c9ee7 otherFunctions
## 13: deb774406e1a36c71f4814eec81c9ee7 otherFunctions
## 14: deb774406e1a36c71f4814eec81c9ee7 otherFunctions
## 15: deb774406e1a36c71f4814eec81c9ee7 otherFunctions
## 16: deb774406e1a36c71f4814eec81c9ee7 otherFunctions
## 17: deb774406e1a36c71f4814eec81c9ee7 otherFunctions
## 18: deb774406e1a36c71f4814eec81c9ee7 otherFunctions
## 19: deb774406e1a36c71f4814eec81c9ee7 otherFunctions
## 20: deb774406e1a36c71f4814eec81c9ee7      preDigest
## 21: deb774406e1a36c71f4814eec81c9ee7      preDigest
##                             artifact         tagKey
##                             tagValue         createdDate
##  1:                              rda 2019-09-11 13:06:12
##  2: deb774406e1a36c71f4814eec81c9ee7 2019-09-11 13:06:12
##  3:                          numeric 2019-09-11 13:06:12
##  4:              2019-09-11 13:06:12 2019-09-11 13:06:12
##  5:                 f7bee22047b8d0c1 2019-09-11 13:06:12
##  6:                                a 2019-09-11 13:06:12
##  7:                            rnorm 2019-09-11 13:06:12
##  8:                             1008 2019-09-11 13:06:12
##  9:              2019-09-11 13:06:12 2019-09-11 13:06:12
## 10:                 vweave_rmarkdown 2019-09-11 13:06:12
## 11:                     process_file 2019-09-11 13:06:12
## 12:                    process_group 2019-09-11 13:06:12
## 13:              process_group.block 2019-09-11 13:06:12
## 14:                       call_block 2019-09-11 13:06:12
## 15:                       block_exec 2019-09-11 13:06:12
## 16:                           in_dir 2019-09-11 13:06:12
## 17:                        timing_fn 2019-09-11 13:06:12
## 18:                           handle 2019-09-11 13:06:12
## 19:                      withVisible 2019-09-11 13:06:12
## 20:               n:7eef4eae85fd9229 2019-09-11 13:06:12
## 21:            .FUN:4f604aa46882b368 2019-09-11 13:06:12
##                             tagValue         createdDate
## Cache size:
##   Total (including Rasters): 252 bytes
##   Selected objects (not including Rasters): 252 bytes
## Cache size:
##   Total (including Rasters): 0 bytes
##   Selected objects (not including Rasters): 0 bytes
## Empty data.table (0 rows and 3 cols): md5hash,name,createdDate

1.7 Example 4: searching for multiple objects in the cache

## Cache size:
##   Total (including Rasters): 504 bytes
##   Selected objects (not including Rasters): 504 bytes
##                             artifact         tagKey
##  1: a4d11c23c568a3e99003c55d15a16781         format
##  2: a4d11c23c568a3e99003c55d15a16781           name
##  3: a4d11c23c568a3e99003c55d15a16781          class
##  4: a4d11c23c568a3e99003c55d15a16781           date
##  5: a4d11c23c568a3e99003c55d15a16781        cacheId
##  6: a4d11c23c568a3e99003c55d15a16781     objectName
##  7: a4d11c23c568a3e99003c55d15a16781       function
##  8: a4d11c23c568a3e99003c55d15a16781    object.size
##  9: a4d11c23c568a3e99003c55d15a16781       accessed
## 10: a4d11c23c568a3e99003c55d15a16781 otherFunctions
## 11: a4d11c23c568a3e99003c55d15a16781 otherFunctions
## 12: a4d11c23c568a3e99003c55d15a16781 otherFunctions
## 13: a4d11c23c568a3e99003c55d15a16781 otherFunctions
## 14: a4d11c23c568a3e99003c55d15a16781 otherFunctions
## 15: a4d11c23c568a3e99003c55d15a16781 otherFunctions
## 16: a4d11c23c568a3e99003c55d15a16781 otherFunctions
## 17: a4d11c23c568a3e99003c55d15a16781 otherFunctions
## 18: a4d11c23c568a3e99003c55d15a16781 otherFunctions
## 19: a4d11c23c568a3e99003c55d15a16781 otherFunctions
## 20: a4d11c23c568a3e99003c55d15a16781      preDigest
## 21: a4d11c23c568a3e99003c55d15a16781      preDigest
## 22: ed11e3916d1da1036dca15cba81b337d         format
## 23: ed11e3916d1da1036dca15cba81b337d           name
## 24: ed11e3916d1da1036dca15cba81b337d          class
## 25: ed11e3916d1da1036dca15cba81b337d           date
## 26: ed11e3916d1da1036dca15cba81b337d        cacheId
## 27: ed11e3916d1da1036dca15cba81b337d     objectName
## 28: ed11e3916d1da1036dca15cba81b337d       function
## 29: ed11e3916d1da1036dca15cba81b337d    object.size
## 30: ed11e3916d1da1036dca15cba81b337d       accessed
## 31: ed11e3916d1da1036dca15cba81b337d otherFunctions
## 32: ed11e3916d1da1036dca15cba81b337d otherFunctions
## 33: ed11e3916d1da1036dca15cba81b337d otherFunctions
## 34: ed11e3916d1da1036dca15cba81b337d otherFunctions
## 35: ed11e3916d1da1036dca15cba81b337d otherFunctions
## 36: ed11e3916d1da1036dca15cba81b337d otherFunctions
## 37: ed11e3916d1da1036dca15cba81b337d otherFunctions
## 38: ed11e3916d1da1036dca15cba81b337d otherFunctions
## 39: ed11e3916d1da1036dca15cba81b337d otherFunctions
## 40: ed11e3916d1da1036dca15cba81b337d otherFunctions
## 41: ed11e3916d1da1036dca15cba81b337d      preDigest
## 42: ed11e3916d1da1036dca15cba81b337d      preDigest
##                             artifact         tagKey
##                             tagValue         createdDate
##  1:                              rda 2019-09-11 13:06:12
##  2: a4d11c23c568a3e99003c55d15a16781 2019-09-11 13:06:12
##  3:                          numeric 2019-09-11 13:06:12
##  4:              2019-09-11 13:06:12 2019-09-11 13:06:12
##  5:                 3aef38d1fc02aee5 2019-09-11 13:06:12
##  6:                                a 2019-09-11 13:06:12
##  7:                            runif 2019-09-11 13:06:12
##  8:                             1008 2019-09-11 13:06:12
##  9:              2019-09-11 13:06:12 2019-09-11 13:06:12
## 10:                 vweave_rmarkdown 2019-09-11 13:06:12
## 11:                     process_file 2019-09-11 13:06:12
## 12:                    process_group 2019-09-11 13:06:12
## 13:              process_group.block 2019-09-11 13:06:12
## 14:                       call_block 2019-09-11 13:06:12
## 15:                       block_exec 2019-09-11 13:06:12
## 16:                           in_dir 2019-09-11 13:06:12
## 17:                        timing_fn 2019-09-11 13:06:12
## 18:                           handle 2019-09-11 13:06:12
## 19:                      withVisible 2019-09-11 13:06:12
## 20:               n:7eef4eae85fd9229 2019-09-11 13:06:12
## 21:            .FUN:881ec847b7161f3c 2019-09-11 13:06:12
## 22:                              rda 2019-09-11 13:06:12
## 23: ed11e3916d1da1036dca15cba81b337d 2019-09-11 13:06:12
## 24:                          numeric 2019-09-11 13:06:12
## 25:              2019-09-11 13:06:12 2019-09-11 13:06:12
## 26:                 f7bee22047b8d0c1 2019-09-11 13:06:12
## 27:                                b 2019-09-11 13:06:12
## 28:                            rnorm 2019-09-11 13:06:12
## 29:                             1008 2019-09-11 13:06:12
## 30:              2019-09-11 13:06:12 2019-09-11 13:06:12
## 31:                 vweave_rmarkdown 2019-09-11 13:06:12
## 32:                     process_file 2019-09-11 13:06:12
## 33:                    process_group 2019-09-11 13:06:12
## 34:              process_group.block 2019-09-11 13:06:12
## 35:                       call_block 2019-09-11 13:06:12
## 36:                       block_exec 2019-09-11 13:06:12
## 37:                           in_dir 2019-09-11 13:06:12
## 38:                        timing_fn 2019-09-11 13:06:12
## 39:                           handle 2019-09-11 13:06:12
## 40:                      withVisible 2019-09-11 13:06:12
## 41:               n:7eef4eae85fd9229 2019-09-11 13:06:12
## 42:            .FUN:4f604aa46882b368 2019-09-11 13:06:12
##                             tagValue         createdDate
## Cache size:
##   Total (including Rasters): 504 bytes
##   Selected objects (not including Rasters): 0 bytes
## Empty data.table (0 rows and 4 cols): artifact,tagKey,tagValue,createdDate
## Cache size:
##   Total (including Rasters): 504 bytes
##   Selected objects (not including Rasters): 504 bytes
##                             artifact         tagKey
##  1: a4d11c23c568a3e99003c55d15a16781         format
##  2: a4d11c23c568a3e99003c55d15a16781           name
##  3: a4d11c23c568a3e99003c55d15a16781          class
##  4: a4d11c23c568a3e99003c55d15a16781           date
##  5: a4d11c23c568a3e99003c55d15a16781        cacheId
##  6: a4d11c23c568a3e99003c55d15a16781     objectName
##  7: a4d11c23c568a3e99003c55d15a16781       function
##  8: a4d11c23c568a3e99003c55d15a16781    object.size
##  9: a4d11c23c568a3e99003c55d15a16781       accessed
## 10: a4d11c23c568a3e99003c55d15a16781 otherFunctions
## 11: a4d11c23c568a3e99003c55d15a16781 otherFunctions
## 12: a4d11c23c568a3e99003c55d15a16781 otherFunctions
## 13: a4d11c23c568a3e99003c55d15a16781 otherFunctions
## 14: a4d11c23c568a3e99003c55d15a16781 otherFunctions
## 15: a4d11c23c568a3e99003c55d15a16781 otherFunctions
## 16: a4d11c23c568a3e99003c55d15a16781 otherFunctions
## 17: a4d11c23c568a3e99003c55d15a16781 otherFunctions
## 18: a4d11c23c568a3e99003c55d15a16781 otherFunctions
## 19: a4d11c23c568a3e99003c55d15a16781 otherFunctions
## 20: a4d11c23c568a3e99003c55d15a16781      preDigest
## 21: a4d11c23c568a3e99003c55d15a16781      preDigest
## 22: ed11e3916d1da1036dca15cba81b337d         format
## 23: ed11e3916d1da1036dca15cba81b337d           name
## 24: ed11e3916d1da1036dca15cba81b337d          class
## 25: ed11e3916d1da1036dca15cba81b337d           date
## 26: ed11e3916d1da1036dca15cba81b337d        cacheId
## 27: ed11e3916d1da1036dca15cba81b337d     objectName
## 28: ed11e3916d1da1036dca15cba81b337d       function
## 29: ed11e3916d1da1036dca15cba81b337d    object.size
## 30: ed11e3916d1da1036dca15cba81b337d       accessed
## 31: ed11e3916d1da1036dca15cba81b337d otherFunctions
## 32: ed11e3916d1da1036dca15cba81b337d otherFunctions
## 33: ed11e3916d1da1036dca15cba81b337d otherFunctions
## 34: ed11e3916d1da1036dca15cba81b337d otherFunctions
## 35: ed11e3916d1da1036dca15cba81b337d otherFunctions
## 36: ed11e3916d1da1036dca15cba81b337d otherFunctions
## 37: ed11e3916d1da1036dca15cba81b337d otherFunctions
## 38: ed11e3916d1da1036dca15cba81b337d otherFunctions
## 39: ed11e3916d1da1036dca15cba81b337d otherFunctions
## 40: ed11e3916d1da1036dca15cba81b337d otherFunctions
## 41: ed11e3916d1da1036dca15cba81b337d      preDigest
## 42: ed11e3916d1da1036dca15cba81b337d      preDigest
##                             artifact         tagKey
##                             tagValue         createdDate
##  1:                              rda 2019-09-11 13:06:12
##  2: a4d11c23c568a3e99003c55d15a16781 2019-09-11 13:06:12
##  3:                          numeric 2019-09-11 13:06:12
##  4:              2019-09-11 13:06:12 2019-09-11 13:06:12
##  5:                 3aef38d1fc02aee5 2019-09-11 13:06:12
##  6:                                a 2019-09-11 13:06:12
##  7:                            runif 2019-09-11 13:06:12
##  8:                             1008 2019-09-11 13:06:12
##  9:              2019-09-11 13:06:12 2019-09-11 13:06:12
## 10:                 vweave_rmarkdown 2019-09-11 13:06:12
## 11:                     process_file 2019-09-11 13:06:12
## 12:                    process_group 2019-09-11 13:06:12
## 13:              process_group.block 2019-09-11 13:06:12
## 14:                       call_block 2019-09-11 13:06:12
## 15:                       block_exec 2019-09-11 13:06:12
## 16:                           in_dir 2019-09-11 13:06:12
## 17:                        timing_fn 2019-09-11 13:06:12
## 18:                           handle 2019-09-11 13:06:12
## 19:                      withVisible 2019-09-11 13:06:12
## 20:               n:7eef4eae85fd9229 2019-09-11 13:06:12
## 21:            .FUN:881ec847b7161f3c 2019-09-11 13:06:12
## 22:                              rda 2019-09-11 13:06:12
## 23: ed11e3916d1da1036dca15cba81b337d 2019-09-11 13:06:12
## 24:                          numeric 2019-09-11 13:06:12
## 25:              2019-09-11 13:06:12 2019-09-11 13:06:12
## 26:                 f7bee22047b8d0c1 2019-09-11 13:06:12
## 27:                                b 2019-09-11 13:06:12
## 28:                            rnorm 2019-09-11 13:06:12
## 29:                             1008 2019-09-11 13:06:12
## 30:              2019-09-11 13:06:12 2019-09-11 13:06:12
## 31:                 vweave_rmarkdown 2019-09-11 13:06:12
## 32:                     process_file 2019-09-11 13:06:12
## 33:                    process_group 2019-09-11 13:06:12
## 34:              process_group.block 2019-09-11 13:06:12
## 35:                       call_block 2019-09-11 13:06:12
## 36:                       block_exec 2019-09-11 13:06:12
## 37:                           in_dir 2019-09-11 13:06:12
## 38:                        timing_fn 2019-09-11 13:06:12
## 39:                           handle 2019-09-11 13:06:12
## 40:                      withVisible 2019-09-11 13:06:12
## 41:               n:7eef4eae85fd9229 2019-09-11 13:06:12
## 42:            .FUN:4f604aa46882b368 2019-09-11 13:06:12
##                             tagValue         createdDate
## Cache size:
##   Total (including Rasters): 504 bytes
##   Selected objects (not including Rasters): 504 bytes
##                             artifact         tagKey
##  1: a4d11c23c568a3e99003c55d15a16781         format
##  2: a4d11c23c568a3e99003c55d15a16781           name
##  3: a4d11c23c568a3e99003c55d15a16781          class
##  4: a4d11c23c568a3e99003c55d15a16781           date
##  5: a4d11c23c568a3e99003c55d15a16781        cacheId
##  6: a4d11c23c568a3e99003c55d15a16781     objectName
##  7: a4d11c23c568a3e99003c55d15a16781       function
##  8: a4d11c23c568a3e99003c55d15a16781    object.size
##  9: a4d11c23c568a3e99003c55d15a16781       accessed
## 10: a4d11c23c568a3e99003c55d15a16781 otherFunctions
## 11: a4d11c23c568a3e99003c55d15a16781 otherFunctions
## 12: a4d11c23c568a3e99003c55d15a16781 otherFunctions
## 13: a4d11c23c568a3e99003c55d15a16781 otherFunctions
## 14: a4d11c23c568a3e99003c55d15a16781 otherFunctions
## 15: a4d11c23c568a3e99003c55d15a16781 otherFunctions
## 16: a4d11c23c568a3e99003c55d15a16781 otherFunctions
## 17: a4d11c23c568a3e99003c55d15a16781 otherFunctions
## 18: a4d11c23c568a3e99003c55d15a16781 otherFunctions
## 19: a4d11c23c568a3e99003c55d15a16781 otherFunctions
## 20: a4d11c23c568a3e99003c55d15a16781      preDigest
## 21: a4d11c23c568a3e99003c55d15a16781      preDigest
## 22: ed11e3916d1da1036dca15cba81b337d         format
## 23: ed11e3916d1da1036dca15cba81b337d           name
## 24: ed11e3916d1da1036dca15cba81b337d          class
## 25: ed11e3916d1da1036dca15cba81b337d           date
## 26: ed11e3916d1da1036dca15cba81b337d        cacheId
## 27: ed11e3916d1da1036dca15cba81b337d     objectName
## 28: ed11e3916d1da1036dca15cba81b337d       function
## 29: ed11e3916d1da1036dca15cba81b337d    object.size
## 30: ed11e3916d1da1036dca15cba81b337d       accessed
## 31: ed11e3916d1da1036dca15cba81b337d otherFunctions
## 32: ed11e3916d1da1036dca15cba81b337d otherFunctions
## 33: ed11e3916d1da1036dca15cba81b337d otherFunctions
## 34: ed11e3916d1da1036dca15cba81b337d otherFunctions
## 35: ed11e3916d1da1036dca15cba81b337d otherFunctions
## 36: ed11e3916d1da1036dca15cba81b337d otherFunctions
## 37: ed11e3916d1da1036dca15cba81b337d otherFunctions
## 38: ed11e3916d1da1036dca15cba81b337d otherFunctions
## 39: ed11e3916d1da1036dca15cba81b337d otherFunctions
## 40: ed11e3916d1da1036dca15cba81b337d otherFunctions
## 41: ed11e3916d1da1036dca15cba81b337d      preDigest
## 42: ed11e3916d1da1036dca15cba81b337d      preDigest
##                             artifact         tagKey
##                             tagValue         createdDate
##  1:                              rda 2019-09-11 13:06:12
##  2: a4d11c23c568a3e99003c55d15a16781 2019-09-11 13:06:12
##  3:                          numeric 2019-09-11 13:06:12
##  4:              2019-09-11 13:06:12 2019-09-11 13:06:12
##  5:                 3aef38d1fc02aee5 2019-09-11 13:06:12
##  6:                                a 2019-09-11 13:06:12
##  7:                            runif 2019-09-11 13:06:12
##  8:                             1008 2019-09-11 13:06:12
##  9:              2019-09-11 13:06:12 2019-09-11 13:06:12
## 10:                 vweave_rmarkdown 2019-09-11 13:06:12
## 11:                     process_file 2019-09-11 13:06:12
## 12:                    process_group 2019-09-11 13:06:12
## 13:              process_group.block 2019-09-11 13:06:12
## 14:                       call_block 2019-09-11 13:06:12
## 15:                       block_exec 2019-09-11 13:06:12
## 16:                           in_dir 2019-09-11 13:06:12
## 17:                        timing_fn 2019-09-11 13:06:12
## 18:                           handle 2019-09-11 13:06:12
## 19:                      withVisible 2019-09-11 13:06:12
## 20:               n:7eef4eae85fd9229 2019-09-11 13:06:12
## 21:            .FUN:881ec847b7161f3c 2019-09-11 13:06:12
## 22:                              rda 2019-09-11 13:06:12
## 23: ed11e3916d1da1036dca15cba81b337d 2019-09-11 13:06:12
## 24:                          numeric 2019-09-11 13:06:12
## 25:              2019-09-11 13:06:12 2019-09-11 13:06:12
## 26:                 f7bee22047b8d0c1 2019-09-11 13:06:12
## 27:                                b 2019-09-11 13:06:12
## 28:                            rnorm 2019-09-11 13:06:12
## 29:                             1008 2019-09-11 13:06:12
## 30:              2019-09-11 13:06:12 2019-09-11 13:06:12
## 31:                 vweave_rmarkdown 2019-09-11 13:06:12
## 32:                     process_file 2019-09-11 13:06:12
## 33:                    process_group 2019-09-11 13:06:12
## 34:              process_group.block 2019-09-11 13:06:12
## 35:                       call_block 2019-09-11 13:06:12
## 36:                       block_exec 2019-09-11 13:06:12
## 37:                           in_dir 2019-09-11 13:06:12
## 38:                        timing_fn 2019-09-11 13:06:12
## 39:                           handle 2019-09-11 13:06:12
## 40:                      withVisible 2019-09-11 13:06:12
## 41:               n:7eef4eae85fd9229 2019-09-11 13:06:12
## 42:            .FUN:4f604aa46882b368 2019-09-11 13:06:12
##                             tagValue         createdDate

1.8 Example 5: using caching to speed up rerunning expensive computations

##   loading cached result from previous projectRaster call, adding to memoised copy
## [1] TRUE

1.9 Nested Caching

Nested caching, which is when Caching of a function occurs inside an outer function, which is itself cached. This is a critical element to working within a reproducible work flow. It is not enough during development to cache flat code chunks, as there will be many levels of “slow” functions. Ideally, at all points in a development cycle, it should be possible to get to any line of code starting from the very initial steps, running through everything up to that point, in less that 1 second. If the workflow can be kept very fast like this, then there is a guarantee that it will work at any point.

## [1]  0.7706254  0.2526370 -1.0965456
## attr(,".Cache")
## attr(,".Cache")$newCache
## [1] TRUE
## 
## attr(,"tags")
## [1] "cacheId:a7af5367c13aba8f"
## attr(,"call")
## [1] ""
## Cache size:
##   Total (including Rasters): 504 bytes
##   Selected objects (not including Rasters): 504 bytes
##                             artifact         tagKey
##  1: 1fcdd64e799624731d8fb7534e39675b         format
##  2: 1fcdd64e799624731d8fb7534e39675b           name
##  3: 1fcdd64e799624731d8fb7534e39675b          class
##  4: 1fcdd64e799624731d8fb7534e39675b           date
##  5: 1fcdd64e799624731d8fb7534e39675b        cacheId
##  6: 1fcdd64e799624731d8fb7534e39675b       function
##  7: 1fcdd64e799624731d8fb7534e39675b    object.size
##  8: 1fcdd64e799624731d8fb7534e39675b       accessed
##  9: 1fcdd64e799624731d8fb7534e39675b otherFunctions
## 10: 1fcdd64e799624731d8fb7534e39675b otherFunctions
## 11: 1fcdd64e799624731d8fb7534e39675b otherFunctions
## 12: 1fcdd64e799624731d8fb7534e39675b otherFunctions
## 13: 1fcdd64e799624731d8fb7534e39675b otherFunctions
## 14: 1fcdd64e799624731d8fb7534e39675b otherFunctions
## 15: 1fcdd64e799624731d8fb7534e39675b otherFunctions
## 16: 1fcdd64e799624731d8fb7534e39675b otherFunctions
## 17: 1fcdd64e799624731d8fb7534e39675b otherFunctions
## 18: 1fcdd64e799624731d8fb7534e39675b otherFunctions
## 19: 1fcdd64e799624731d8fb7534e39675b      preDigest
## 20: 1fcdd64e799624731d8fb7534e39675b      preDigest
## 21: 1fcdd64e799624731d8fb7534e39675b      preDigest
## 22: c436b31675c7e99a603c897e81850837         format
## 23: c436b31675c7e99a603c897e81850837           name
## 24: c436b31675c7e99a603c897e81850837          class
## 25: c436b31675c7e99a603c897e81850837           date
## 26: c436b31675c7e99a603c897e81850837        cacheId
## 27: c436b31675c7e99a603c897e81850837       function
## 28: c436b31675c7e99a603c897e81850837    object.size
## 29: c436b31675c7e99a603c897e81850837       accessed
## 30: c436b31675c7e99a603c897e81850837 otherFunctions
## 31: c436b31675c7e99a603c897e81850837 otherFunctions
## 32: c436b31675c7e99a603c897e81850837 otherFunctions
## 33: c436b31675c7e99a603c897e81850837 otherFunctions
## 34: c436b31675c7e99a603c897e81850837 otherFunctions
## 35: c436b31675c7e99a603c897e81850837 otherFunctions
## 36: c436b31675c7e99a603c897e81850837 otherFunctions
## 37: c436b31675c7e99a603c897e81850837 otherFunctions
## 38: c436b31675c7e99a603c897e81850837 otherFunctions
## 39: c436b31675c7e99a603c897e81850837 otherFunctions
## 40: c436b31675c7e99a603c897e81850837      preDigest
## 41: c436b31675c7e99a603c897e81850837      preDigest
##                             artifact         tagKey
##                             tagValue         createdDate
##  1:                              rda 2019-09-11 13:06:12
##  2: 1fcdd64e799624731d8fb7534e39675b 2019-09-11 13:06:13
##  3:                          numeric 2019-09-11 13:06:13
##  4:              2019-09-11 13:06:12 2019-09-11 13:06:13
##  5:                 4ac2b7c0f42d1e46 2019-09-11 13:06:13
##  6:                            rnorm 2019-09-11 13:06:13
##  7:                             1008 2019-09-11 13:06:13
##  8:              2019-09-11 13:06:12 2019-09-11 13:06:13
##  9:                 vweave_rmarkdown 2019-09-11 13:06:13
## 10:                     process_file 2019-09-11 13:06:13
## 11:                    process_group 2019-09-11 13:06:13
## 12:              process_group.block 2019-09-11 13:06:13
## 13:                       call_block 2019-09-11 13:06:13
## 14:                       block_exec 2019-09-11 13:06:13
## 15:                           in_dir 2019-09-11 13:06:13
## 16:                        timing_fn 2019-09-11 13:06:13
## 17:                           handle 2019-09-11 13:06:13
## 18:                      withVisible 2019-09-11 13:06:13
## 19:               n:7f12988bd88a0fb8 2019-09-11 13:06:13
## 20:            mean:22413394efd9f6a3 2019-09-11 13:06:13
## 21:            .FUN:4f604aa46882b368 2019-09-11 13:06:13
## 22:                              rda 2019-09-11 13:06:13
## 23: c436b31675c7e99a603c897e81850837 2019-09-11 13:06:13
## 24:                          numeric 2019-09-11 13:06:13
## 25:              2019-09-11 13:06:13 2019-09-11 13:06:13
## 26:                 a7af5367c13aba8f 2019-09-11 13:06:13
## 27:                            outer 2019-09-11 13:06:13
## 28:                             1008 2019-09-11 13:06:13
## 29:              2019-09-11 13:06:13 2019-09-11 13:06:13
## 30:                 vweave_rmarkdown 2019-09-11 13:06:13
## 31:                     process_file 2019-09-11 13:06:13
## 32:                    process_group 2019-09-11 13:06:13
## 33:              process_group.block 2019-09-11 13:06:13
## 34:                       call_block 2019-09-11 13:06:13
## 35:                       block_exec 2019-09-11 13:06:13
## 36:                           in_dir 2019-09-11 13:06:13
## 37:                        timing_fn 2019-09-11 13:06:13
## 38:                           handle 2019-09-11 13:06:13
## 39:                      withVisible 2019-09-11 13:06:13
## 40:               n:82dc709f2b91918a 2019-09-11 13:06:13
## 41:            .FUN:892a6afc47a63a90 2019-09-11 13:06:13
##                             tagValue         createdDate
## Cache size:
##   Total (including Rasters): 252 bytes
##   Selected objects (not including Rasters): 252 bytes
##                             artifact         tagKey
##  1: b2e6bec7b3fe10c1a7f01cbaaa121831         format
##  2: b2e6bec7b3fe10c1a7f01cbaaa121831           name
##  3: b2e6bec7b3fe10c1a7f01cbaaa121831          class
##  4: b2e6bec7b3fe10c1a7f01cbaaa121831           date
##  5: b2e6bec7b3fe10c1a7f01cbaaa121831        cacheId
##  6: b2e6bec7b3fe10c1a7f01cbaaa121831       function
##  7: b2e6bec7b3fe10c1a7f01cbaaa121831    object.size
##  8: b2e6bec7b3fe10c1a7f01cbaaa121831       accessed
##  9: b2e6bec7b3fe10c1a7f01cbaaa121831 otherFunctions
## 10: b2e6bec7b3fe10c1a7f01cbaaa121831 otherFunctions
## 11: b2e6bec7b3fe10c1a7f01cbaaa121831 otherFunctions
## 12: b2e6bec7b3fe10c1a7f01cbaaa121831 otherFunctions
## 13: b2e6bec7b3fe10c1a7f01cbaaa121831 otherFunctions
## 14: b2e6bec7b3fe10c1a7f01cbaaa121831 otherFunctions
## 15: b2e6bec7b3fe10c1a7f01cbaaa121831 otherFunctions
## 16: b2e6bec7b3fe10c1a7f01cbaaa121831 otherFunctions
## 17: b2e6bec7b3fe10c1a7f01cbaaa121831 otherFunctions
## 18: b2e6bec7b3fe10c1a7f01cbaaa121831 otherFunctions
## 19: b2e6bec7b3fe10c1a7f01cbaaa121831      preDigest
## 20: b2e6bec7b3fe10c1a7f01cbaaa121831      preDigest
##                             tagValue         createdDate
##  1:                              rda 2019-09-11 13:06:13
##  2: b2e6bec7b3fe10c1a7f01cbaaa121831 2019-09-11 13:06:13
##  3:                          numeric 2019-09-11 13:06:13
##  4:              2019-09-11 13:06:13 2019-09-11 13:06:13
##  5:                 33ceb4fb525fd08f 2019-09-11 13:06:13
##  6:                            inner 2019-09-11 13:06:13
##  7:                             1008 2019-09-11 13:06:13
##  8:              2019-09-11 13:06:13 2019-09-11 13:06:13
##  9:                 vweave_rmarkdown 2019-09-11 13:06:13
## 10:                     process_file 2019-09-11 13:06:13
## 11:                    process_group 2019-09-11 13:06:13
## 12:              process_group.block 2019-09-11 13:06:13
## 13:                       call_block 2019-09-11 13:06:13
## 14:                       block_exec 2019-09-11 13:06:13
## 15:                           in_dir 2019-09-11 13:06:13
## 16:                        timing_fn 2019-09-11 13:06:13
## 17:                           handle 2019-09-11 13:06:13
## 18:                      withVisible 2019-09-11 13:06:13
## 19:            mean:22413394efd9f6a3 2019-09-11 13:06:13
## 20:            .FUN:87e2c30917a34d25 2019-09-11 13:06:13
## Cache size:
##   Total (including Rasters): 756 bytes
##   Selected objects (not including Rasters): 756 bytes
##                             artifact         tagKey
##  1: 09efb6cab5fec5b60fb0f15c96672044         format
##  2: 09efb6cab5fec5b60fb0f15c96672044           name
##  3: 09efb6cab5fec5b60fb0f15c96672044          class
##  4: 09efb6cab5fec5b60fb0f15c96672044           date
##  5: 09efb6cab5fec5b60fb0f15c96672044        cacheId
##  6: 09efb6cab5fec5b60fb0f15c96672044       innerTag
##  7: 09efb6cab5fec5b60fb0f15c96672044       outerTag
##  8: 09efb6cab5fec5b60fb0f15c96672044       function
##  9: 09efb6cab5fec5b60fb0f15c96672044    object.size
## 10: 09efb6cab5fec5b60fb0f15c96672044       accessed
## 11: 09efb6cab5fec5b60fb0f15c96672044 otherFunctions
## 12: 09efb6cab5fec5b60fb0f15c96672044 otherFunctions
## 13: 09efb6cab5fec5b60fb0f15c96672044 otherFunctions
## 14: 09efb6cab5fec5b60fb0f15c96672044 otherFunctions
## 15: 09efb6cab5fec5b60fb0f15c96672044 otherFunctions
## 16: 09efb6cab5fec5b60fb0f15c96672044 otherFunctions
## 17: 09efb6cab5fec5b60fb0f15c96672044 otherFunctions
## 18: 09efb6cab5fec5b60fb0f15c96672044 otherFunctions
## 19: 09efb6cab5fec5b60fb0f15c96672044 otherFunctions
## 20: 09efb6cab5fec5b60fb0f15c96672044 otherFunctions
## 21: 09efb6cab5fec5b60fb0f15c96672044      preDigest
## 22: 09efb6cab5fec5b60fb0f15c96672044      preDigest
## 23: 09efb6cab5fec5b60fb0f15c96672044      preDigest
## 24: b4032f10fd0fe5f660a1e217a00ae637         format
## 25: b4032f10fd0fe5f660a1e217a00ae637           name
## 26: b4032f10fd0fe5f660a1e217a00ae637          class
## 27: b4032f10fd0fe5f660a1e217a00ae637           date
## 28: b4032f10fd0fe5f660a1e217a00ae637        cacheId
## 29: b4032f10fd0fe5f660a1e217a00ae637       outerTag
## 30: b4032f10fd0fe5f660a1e217a00ae637       function
## 31: b4032f10fd0fe5f660a1e217a00ae637    object.size
## 32: b4032f10fd0fe5f660a1e217a00ae637       accessed
## 33: b4032f10fd0fe5f660a1e217a00ae637 otherFunctions
## 34: b4032f10fd0fe5f660a1e217a00ae637 otherFunctions
## 35: b4032f10fd0fe5f660a1e217a00ae637 otherFunctions
## 36: b4032f10fd0fe5f660a1e217a00ae637 otherFunctions
## 37: b4032f10fd0fe5f660a1e217a00ae637 otherFunctions
## 38: b4032f10fd0fe5f660a1e217a00ae637 otherFunctions
## 39: b4032f10fd0fe5f660a1e217a00ae637 otherFunctions
## 40: b4032f10fd0fe5f660a1e217a00ae637 otherFunctions
## 41: b4032f10fd0fe5f660a1e217a00ae637 otherFunctions
## 42: b4032f10fd0fe5f660a1e217a00ae637 otherFunctions
## 43: b4032f10fd0fe5f660a1e217a00ae637      preDigest
## 44: b4032f10fd0fe5f660a1e217a00ae637      preDigest
## 45: e151162a801ed95f8fcfa33557bd978d         format
## 46: e151162a801ed95f8fcfa33557bd978d           name
## 47: e151162a801ed95f8fcfa33557bd978d          class
## 48: e151162a801ed95f8fcfa33557bd978d           date
## 49: e151162a801ed95f8fcfa33557bd978d        cacheId
## 50: e151162a801ed95f8fcfa33557bd978d       outerTag
## 51: e151162a801ed95f8fcfa33557bd978d       function
## 52: e151162a801ed95f8fcfa33557bd978d    object.size
## 53: e151162a801ed95f8fcfa33557bd978d       accessed
## 54: e151162a801ed95f8fcfa33557bd978d otherFunctions
## 55: e151162a801ed95f8fcfa33557bd978d otherFunctions
## 56: e151162a801ed95f8fcfa33557bd978d otherFunctions
## 57: e151162a801ed95f8fcfa33557bd978d otherFunctions
## 58: e151162a801ed95f8fcfa33557bd978d otherFunctions
## 59: e151162a801ed95f8fcfa33557bd978d otherFunctions
## 60: e151162a801ed95f8fcfa33557bd978d otherFunctions
## 61: e151162a801ed95f8fcfa33557bd978d otherFunctions
## 62: e151162a801ed95f8fcfa33557bd978d otherFunctions
## 63: e151162a801ed95f8fcfa33557bd978d otherFunctions
## 64: e151162a801ed95f8fcfa33557bd978d      preDigest
## 65: e151162a801ed95f8fcfa33557bd978d      preDigest
##                             artifact         tagKey
##                             tagValue         createdDate
##  1:                              rda 2019-09-11 13:06:13
##  2: 09efb6cab5fec5b60fb0f15c96672044 2019-09-11 13:06:13
##  3:                          numeric 2019-09-11 13:06:13
##  4:              2019-09-11 13:06:13 2019-09-11 13:06:13
##  5:                 4ac2b7c0f42d1e46 2019-09-11 13:06:13
##  6:                         innerTag 2019-09-11 13:06:13
##  7:                         outerTag 2019-09-11 13:06:13
##  8:                            rnorm 2019-09-11 13:06:13
##  9:                             1008 2019-09-11 13:06:13
## 10:              2019-09-11 13:06:13 2019-09-11 13:06:13
## 11:                 vweave_rmarkdown 2019-09-11 13:06:13
## 12:                     process_file 2019-09-11 13:06:13
## 13:                    process_group 2019-09-11 13:06:13
## 14:              process_group.block 2019-09-11 13:06:13
## 15:                       call_block 2019-09-11 13:06:13
## 16:                       block_exec 2019-09-11 13:06:13
## 17:                           in_dir 2019-09-11 13:06:13
## 18:                        timing_fn 2019-09-11 13:06:13
## 19:                           handle 2019-09-11 13:06:13
## 20:                      withVisible 2019-09-11 13:06:13
## 21:               n:7f12988bd88a0fb8 2019-09-11 13:06:13
## 22:            mean:22413394efd9f6a3 2019-09-11 13:06:13
## 23:            .FUN:4f604aa46882b368 2019-09-11 13:06:13
## 24:                              rda 2019-09-11 13:06:13
## 25: b4032f10fd0fe5f660a1e217a00ae637 2019-09-11 13:06:13
## 26:                          numeric 2019-09-11 13:06:13
## 27:              2019-09-11 13:06:13 2019-09-11 13:06:13
## 28:                 b06af03d5a73dc7d 2019-09-11 13:06:13
## 29:                         outerTag 2019-09-11 13:06:13
## 30:                            inner 2019-09-11 13:06:13
## 31:                             1008 2019-09-11 13:06:13
## 32:              2019-09-11 13:06:13 2019-09-11 13:06:13
## 33:                 vweave_rmarkdown 2019-09-11 13:06:13
## 34:                     process_file 2019-09-11 13:06:13
## 35:                    process_group 2019-09-11 13:06:13
## 36:              process_group.block 2019-09-11 13:06:13
## 37:                       call_block 2019-09-11 13:06:13
## 38:                       block_exec 2019-09-11 13:06:13
## 39:                           in_dir 2019-09-11 13:06:13
## 40:                        timing_fn 2019-09-11 13:06:13
## 41:                           handle 2019-09-11 13:06:13
## 42:                      withVisible 2019-09-11 13:06:13
## 43:            mean:22413394efd9f6a3 2019-09-11 13:06:13
## 44:            .FUN:7ad10bc1ae528d8c 2019-09-11 13:06:13
## 45:                              rda 2019-09-11 13:06:13
## 46: e151162a801ed95f8fcfa33557bd978d 2019-09-11 13:06:13
## 47:                          numeric 2019-09-11 13:06:13
## 48:              2019-09-11 13:06:13 2019-09-11 13:06:13
## 49:                 88a34e1d033329e5 2019-09-11 13:06:13
## 50:                         outerTag 2019-09-11 13:06:13
## 51:                            outer 2019-09-11 13:06:13
## 52:                             1008 2019-09-11 13:06:13
## 53:              2019-09-11 13:06:13 2019-09-11 13:06:13
## 54:                 vweave_rmarkdown 2019-09-11 13:06:13
## 55:                     process_file 2019-09-11 13:06:13
## 56:                    process_group 2019-09-11 13:06:13
## 57:              process_group.block 2019-09-11 13:06:13
## 58:                       call_block 2019-09-11 13:06:13
## 59:                       block_exec 2019-09-11 13:06:13
## 60:                           in_dir 2019-09-11 13:06:13
## 61:                        timing_fn 2019-09-11 13:06:13
## 62:                           handle 2019-09-11 13:06:13
## 63:                      withVisible 2019-09-11 13:06:13
## 64:               n:82dc709f2b91918a 2019-09-11 13:06:13
## 65:            .FUN:5f06fb5fbffe9e3b 2019-09-11 13:06:13
##                             tagValue         createdDate

1.10 cacheId

Sometimes, it is not absolutely desirable to maintain the work flow intact because changes that are irrelevant to the analysis, such as changing messages sent to a user, may be changed, without a desire to rerun functions. The cacheId argument is for this. Once a piece of code is run, then the cacheId can be manually extracted (it is reported at the end of a Cache call) and manually placed in the code, passed in as, say, cacheId = "ad184ce64541972b50afd8e7b75f821b".

## [1] -0.6264538
## attr(,".Cache")
## attr(,".Cache")$newCache
## [1] TRUE
## 
## attr(,"tags")
## [1] "cacheId:7072c305d8c69df0"
## attr(,"call")
## [1] ""
## cacheId is not same as calculated hash. Manually searching for cacheId:ad184ce64541972b50afd8e7b75f821b
## [1] 0.1836433
## attr(,".Cache")
## attr(,".Cache")$newCache
## [1] TRUE
## 
## attr(,"tags")
## [1] "cacheId:ad184ce64541972b50afd8e7b75f821b"
## attr(,"call")
## [1] ""
## cacheId is not same as calculated hash. Manually searching for cacheId:ad184ce64541972b50afd8e7b75f821b
##   loading cached result from previous rnorm call, adding to memoised copy
## [1] 0.1836433
## attr(,".Cache")
## attr(,".Cache")$newCache
## [1] FALSE
## 
## attr(,"tags")
## [1] "cacheId:ad184ce64541972b50afd8e7b75f821b"
## attr(,"call")
## [1] ""

1.11 Working with the Cache manually

Since the cache is simply an archivist repository, all archivist functions will work as is. In addition, there are several helpers in the reproducible package, including showCache, keepCache and clearCache that may be useful. Also, one can access cached items manually (rather than simply rerunning the same Cache function again).

## Cache size:
##   Total (including Rasters): 3.3 Kb
##   Selected objects (not including Rasters): 3.3 Kb

2 Reproducible Workflow

In general, we feel that a liberal use of Cache will make a re-usable and reproducible work flow. shiny apps can be made, taking advantage of Cache. Indeed, much of the difficulty in managing data sets and saving them for future use, can be accommodated by caching.

2.1 Nested Caching

2.1.0.1 Cache individual functions

Cache(<functionName>, <other arguments>)

This will allow fine scale control of individual function calls.