Given a cache name, this function will attempt to delete the cache of that name on disk.

deleteCaches(cacheNames, cacheDir = getOption("RCACHE.DIR"),
  force = FALSE)

Arguments

cacheNames

Name(s) of the cache to delete

cacheDir

Directory where caches are kept

force

Force deletion without user prompt

Examples

# choose location to store caches cacheDir = tempdir() cacheDir
#> [1] "/var/folders/3f/0wj7rs2144l9zsgxd3jn5nxc0000gn/T//Rtmp20Pfxj"
setCacheDir(cacheDir) # build some caches simpleCache("normSample", { rnorm(5e3, 0,1) }, recreate=TRUE, timer=TRUE)
#> ::Creating cache:: /var/folders/3f/0wj7rs2144l9zsgxd3jn5nxc0000gn/T//Rtmp20Pfxj/normSample.RData
#> <00h 00m 0.0s>
simpleCache("normSample", { rnorm(5e3, 0,1) })
#> ::Loading cache:: /var/folders/3f/0wj7rs2144l9zsgxd3jn5nxc0000gn/T//Rtmp20Pfxj/normSample.RData
simpleCache("normSample", { rnorm(5e3, 0,1) }, reload=TRUE)
#> ::Loading cache:: /var/folders/3f/0wj7rs2144l9zsgxd3jn5nxc0000gn/T//Rtmp20Pfxj/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:: /var/folders/3f/0wj7rs2144l9zsgxd3jn5nxc0000gn/T//Rtmp20Pfxj/normSample.RData
# load multiples caches loadCaches(c("normSample", "normSample2"), reload=TRUE)
#> ::Loading cache:: /var/folders/3f/0wj7rs2144l9zsgxd3jn5nxc0000gn/T//Rtmp20Pfxj/normSample.RData
#> ::Creating cache:: /var/folders/3f/0wj7rs2144l9zsgxd3jn5nxc0000gn/T//Rtmp20Pfxj/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().