Learn R Programming

targets (version 0.0.0.9000)

tar_delete: Delete target return values.

Description

Delete the return values of targets in _targets/objects/. but keep the records in _targets/meta/meta. Dynamic files outside the data store are unaffected. The _targets/ data store must be in the current working directory.

Usage

tar_delete(names)

Arguments

names

Names of the targets to remove from _targets/objects/. 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 deleted. 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_delete(starts_with("y")) # Only deletes 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