drake (version 7.5.2)

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 = NULL, search = NULL, verbose = 1L,
  cache = drake::drake_cache(path = path, verbose = verbose),
  force = FALSE)

Arguments

path

Path to a drake cache (usually a hidden .drake/ folder) or NULL.

search

Deprecated.

verbose

Integer, control printing to the console/terminal.

  • 0: print nothing.

  • 1: print targets, retries, and failures.

  • 2: also show a spinner when preprocessing tasks are underway.

cache

drake cache. See new_cache(). If supplied, path is ignored.

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 {
isolate_example("Quarantine side effects.", {
if (suppressWarnings(require("knitr"))) {
load_mtcars_example() # Get the code with drake_example("mtcars").
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