Along with tar_visnetwork()
and tar_glimpse()
,
tar_manifest()
helps check that you constructed your pipeline correctly.
Usage
tar_manifest(
names = NULL,
fields = tidyselect::any_of(c("name", "command", "pattern", "description")),
drop_missing = TRUE,
callr_function = callr::r,
callr_arguments = targets::tar_callr_args_default(callr_function),
envir = parent.frame(),
script = targets::tar_config_get("script")
)
Arguments
- names
Names of the targets to show. Set to
NULL
to show all the targets (default). Otherwise, the object supplied tonames
should be atidyselect
expression likeany_of()
orstarts_with()
fromtidyselect
itself, ortar_described_as()
to select target names based on their descriptions.- fields
Names of the fields, or columns, to show. Set to
NULL
to show all the fields (default). Otherwise, the value offields
should be atidyselect
expression likestarts_with()
to select the columns to show in the output. Possible fields are below. All of them can be set intar_target()
,tar_target_raw()
, ortar_option_set()
.name
: Name of the target.command
: the R command that runs when the target runs.description
: custom free-form text description of the target, if available.pattern
: branching pattern of the target, if applicable.format
: Storage format.repository
: Storage repository.iteration
: Iteration mode for branching.error
: Error mode, what to do when the target fails.memory
: Memory mode, when to keep targets in memory.storage
: Storage mode for high-performance computing scenarios.retrieval
: Retrieval mode for high-performance computing scenarios.deployment
: Where/whether to deploy the target in high-performance computing scenarios.priority
: Numeric of length 1 between 0 and 1. Controls which targets get deployed first when multiple competing targets are ready simultaneously. Targets with priorities closer to 1 get dispatched earlier (and polled earlier intar_make_future()
).resources
: A list of target-specific resource requirements fortar_make_future()
.cue_mode
: Cue mode fromtar_cue()
.cue_depend
: Depend cue fromtar_cue()
.cue_expr
: Command cue fromtar_cue()
.cue_file
: File cue fromtar_cue()
.cue_format
: Format cue fromtar_cue()
.cue_repository
: Repository cue fromtar_cue()
.cue_iteration
: Iteration cue fromtar_cue()
.packages
: List columns of packages loaded before running the target.library
: List column of library paths to load the packages.
- drop_missing
Logical of length 1, whether to automatically omit empty columns and columns with all missing values.
- callr_function
A function from
callr
to start a fresh clean R process to do the work. Set toNULL
to run in the current session instead of an external process (but restart your R session just before you do in order to clear debris out of the global environment).callr_function
needs to beNULL
for interactive debugging, e.g.tar_option_set(debug = "your_target")
. However,callr_function
should not beNULL
for serious reproducible work.- callr_arguments
A list of arguments to
callr_function
.- envir
An environment, where to run the target R script (default:
_targets.R
) ifcallr_function
isNULL
. Ignored ifcallr_function
is anything other thanNULL
.callr_function
should only beNULL
for debugging and testing purposes, not for serious runs of a pipeline, etc.The
envir
argument oftar_make()
and related functions always overrides the current value oftar_option_get("envir")
in the current R session just before running the target script file, so whenever you need to set an alternativeenvir
, you should always set it withtar_option_set()
from within the target script file. In other words, if you calltar_option_set(envir = envir1)
in an interactive session and thentar_make(envir = envir2, callr_function = NULL)
, thenenvir2
will be used.- script
Character of length 1, path to the target script file. Defaults to
tar_config_get("script")
, which in turn defaults to_targets.R
. When you set this argument, the value oftar_config_get("script")
is temporarily changed for the current function call. Seetar_script()
,tar_config_get()
, andtar_config_set()
for details about the target script file and how to set it persistently for a project.
Value
A data frame of information about the targets in the pipeline. Rows appear in topological order (the order they will run without any influence from parallel computing or priorities).
Storage access
Several functions like tar_make()
, tar_read()
, tar_load()
,
tar_meta()
, and tar_progress()
read or modify
the local data store of the pipeline.
The local data store is in flux while a pipeline is running,
and depending on how distributed computing or cloud computing is set up,
not all targets can even reach it. So please do not call these
functions from inside a target as part of a running
pipeline. The only exception is literate programming
target factories in the tarchetypes
package such as tar_render()
and tar_quarto()
.
See also
Other inspect:
tar_deps()
,
tar_network()
,
tar_outdated()
,
tar_sitrep()
,
tar_validate()
Examples
if (identical(Sys.getenv("TAR_EXAMPLES"), "true")) { # for CRAN
tar_dir({ # tar_dir() runs code from a temp dir for CRAN.
tar_script({
library(targets)
library(tarchetypes)
tar_option_set()
list(
tar_target(y1, 1 + 1),
tar_target(y2, 1 + 1),
tar_target(z, y1 + y2),
tar_target(m, z, pattern = map(z), description = "branching over z"),
tar_target(c, z, pattern = cross(z))
)
}, ask = FALSE)
tar_manifest()
tar_manifest(fields = any_of(c("name", "command")))
tar_manifest(fields = any_of("command"))
tar_manifest(fields = starts_with("cue"))
})
}