Garbage collection removes obsolete target values from the cache.
drake_gc( path = NULL, search = NULL, verbose = NULL, cache = drake::drake_cache(path = path), force = FALSE )
path | Path to a |
---|---|
search | Deprecated. |
verbose | Deprecated on 2019-09-11. |
cache | drake cache. See |
force | Logical, whether to load the cache despite any back compatibility issues with the running version of drake. |
NULL
Caution: garbage collection actually removes data
so it is no longer recoverable with drake_history()
or
make(recover = TRUE)
. You cannot undo this operation.
Use at your own risk.
if (FALSE) { 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. } }) }