Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

tar_definition

For developers only: get the definition of the current target.


Description

For developers only: get the full definition of the target currently running. This target definition is the same kind of object produced by tar_target().

Usage

tar_definition(
  default = targets::tar_target_raw("target_name", quote(identity()))
)

Arguments

default

Environment, value to return if tar_definition() is called on its own outside a targets pipeline. Having a default lets users run things without tar_make(), which helps peel back layers of code and troubleshoot bugs.

Details

Most users should not use tar_definition() because accidental modifications could break the pipeline. tar_definition() only exists in order to support third-party interface packages, and even then the returned target definition is not modified..

Value

If called from a running target, tar_definition() returns the target object of the currently running target. See the "Target objects" section for details.

Target objects

Functions like tar_target() produce target objects, special objects with specialized sets of S3 classes. Target objects represent skippable steps of the analysis pipeline as described at https://books.ropensci.org/targets/. Please read the walkthrough at https://books.ropensci.org/targets/walkthrough.html to understand the role of target objects in analysis pipelines.

For developers, https://wlandau.github.io/targetopia/contributing.html#target-factories explains target factories (functions like this one which generate targets) and the design specification at https://books.ropensci.org/targets-design/ details the structure and composition of target objects.

See Also

Examples

class(tar_definition())
tar_definition()$settings$name
if (identical(Sys.getenv("TAR_EXAMPLES"), "true")) {
tar_dir({ # tar_dir() runs code from a temporary directory.
tar_script(
  tar_target(x, tar_definition()$settings$memory, memory = "transient")
)
tar_make(x)
tar_read(x)
})
}

targets

Dynamic Function-Oriented 'Make'-Like Declarative Workflows

v0.10.0
MIT + file LICENSE
Authors
William Michael Landau [aut, cre] (<https://orcid.org/0000-0003-1878-3253>), Matthew T. Warkentin [ctb], Samantha Oliver [rev] (<https://orcid.org/0000-0001-5668-1165>), Tristan Mahr [rev] (<https://orcid.org/0000-0002-8890-5116>), Eli Lilly and Company [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.