This function just takes a list of caches, and loads them. It's designed for stuff you already cached previously, so it won't build any caches.

loadCaches(cacheNames, loadEnvir = NULL, ...)

Arguments

cacheNames

Vector of caches to load.

loadEnvir

Environment into which to load each cache.

...

Additional parameters passed to simpleCache.

Examples

# choose location to store caches cacheDir = tempdir() cacheDir
#> [1] "/tmp/RtmpnwNyJo"
setCacheDir(cacheDir) # build some caches simpleCache("normSample", { rnorm(5e3, 0,1) }, recreate=TRUE, timer=TRUE)
#> ::Creating cache:: /tmp/RtmpnwNyJo/normSample.RData
#> <00h 00m 0.0s>
simpleCache("normSample", { rnorm(5e3, 0,1) })
#> ::Loading cache:: /tmp/RtmpnwNyJo/normSample.RData
simpleCache("normSample", { rnorm(5e3, 0,1) }, reload=TRUE)
#> ::Loading cache:: /tmp/RtmpnwNyJo/normSample.RData
# storing a cache after-the-fact normSample2 = rnorm(10, 0, 1) storeCache("normSample2")
#> ::Object does not exist:: normSample2
#> NULL
# what's available? listCaches()
#> [1] "normSample.RData"
# load a cache simpleCache("normSample")
#> ::Loading cache:: /tmp/RtmpnwNyJo/normSample.RData
# load multiples caches loadCaches(c("normSample", "normSample2"), reload=TRUE)
#> ::Loading cache:: /tmp/RtmpnwNyJo/normSample.RData
#> ::Creating cache:: /tmp/RtmpnwNyJo/normSample2.RData
#> Error in doTryCatch(return(expr), name, parentenv, handler): ::Error:: If you do not provide an instruction argument, you must setglobal option RBUILD.DIR with setCacheBuildDir, or specify a buildDirparameter directly to simpleCache().