Learn R Programming

targets (version 0.0.0.9000)

tar_invalidate: Invalidate targets and global objects in the metadata.

Description

Delete the metadata of records in _targets/meta/meta but keep the return values of targets in _targets/objects/. The _targets/ data store must be in the current working directory.

Usage

tar_invalidate(names)

Arguments

names

Names of the targets to remove from the metadata list. You can supply symbols, a character vector, or tidyselect helpers like starts_with().

Details

For patterns recorded in the metadata, all the branches will be invalidated. For patterns no longer in the metadata, branches are left alone.

Examples

Run this code
# NOT RUN {
tar_dir({
tar_script(
  tar_pipeline(
    tar_target(y1, 1 + 1),
    tar_target(y2, 1 + 1),
    tar_target(z, y1 + y2)
  )
)
tar_make()
tar_invalidate(starts_with("y")) # Only invalidates y1 and y2.
tar_make() # y1 and y2 rebuild but return same values, so z is up to date.
})
# }

Run the code above in your browser using DataLab