Learn R Programming

drake (version 5.0.0)

drake_gc: Do garbage collection on the drake cache.

Description

The cache is a key-value store. By default, the clean() function removes values, but not keys. Garbage collection removes the remaining dangling files.

Usage

drake_gc(path = getwd(), search = TRUE, verbose = 1, cache = NULL,
  force = FALSE)

Arguments

path

file path to the folder containing the cache. Yes, this is the parent directory containing the cache, not the cache itself, and it assumes the cache is in the `.drake` folder. If you are looking for a different cache with a known folder different from `.drake`, use the this_cache() function.

search

logical, whether to search back in the file system for the cache.

verbose

logical, whether to print the location of the cache

cache

the drake/storr cache object itself, if available.

force

logical, whether to load the cache despite any back compatibility issues with the running version of drake.

Value

NULL

See Also

clean

Examples

Run this code
# NOT RUN {
test_with_dir("Quarantine side effects.", {
load_basic_example() # Get the code with drake_example("basic").
make(my_plan) # Run the project, build the targets.
# At this point, check the size of the '.drake/' cache folder.
# Clean without garbage collection.
clean(garbage_collection = FALSE)
# The '.drake/' cache folder is still about the same size.
drake_gc() # Do garbage collection on the cache.
# The '.drake/' cache folder should have gotten much smaller.
})
# }

Run the code above in your browser using DataLab