which_clean {drake}R Documentation

Which targets will clean() invalidate? [Stable]

Description

which_clean() is a safety check for clean(). It shows you the targets that clean() will invalidate (or remove if garbage_collection is TRUE). It helps you avoid accidentally removing targets you care about.

Usage

which_clean(
  ...,
  list = character(0),
  path = NULL,
  cache = drake::drake_cache(path = path)
)

Arguments

...

Targets to remove from the cache: as names (symbols) or character strings. If the tidyselect package is installed, you can also supply dplyr-style tidyselect commands such as starts_with(), ends_with(), and one_of().

list

Character vector naming targets to be removed from the cache. Similar to the list argument of remove().

path

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

cache

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

See Also

clean()

Examples

## Not run: 
isolate_example("Quarantine side effects.", {
plan <- drake_plan(x = 1, y = 2, z = 3)
make(plan)
cached()
which_clean(x, y) # [1] "x" "y"
clean(x, y)       # Invalidates targets x and y.
cached()          # [1] "z"
})

## End(Not run)

[Package drake version 7.13.2 Index]