Skip to contents

Wraps targets::tar_target_raw() to create a primary target and a companion _date target that records Sys.Date() whenever the primary target runs.

Usage

tar_target_date(name, command, ...)

Arguments

name

Symbol, name of the target.

command

Expression, R command to run the target.

...

Additional arguments passed to targets::tar_target_raw().

Value

A list of two target objects: the primary target and the companion _date target.

Examples

if (identical(Sys.getenv("TAR_EXAMPLES"), "true")) {
targets::tar_dir({
  targets::tar_script({
    library(targets)
    list(
      epitargets::tar_target_date(x, 1 + 1)
    )
  })
  targets::tar_make()
  targets::tar_read(x)
  targets::tar_read(x_date)
})
}