Last chance! 50% off unlimited learning
Sale ends in
Return the saved traceback of a target.
Assumes the target errored out in a previous run of the pipeline
with workspaces enabled for that target.
See tar_workspace()
for details.
tar_traceback(
name,
envir = NULL,
packages = NULL,
source = NULL,
characters = getOption("width"),
store = targets::tar_config_get("store")
)
Symbol, name of the target whose workspace to read.
Deprecated in targets
> 0.3.1 (2021-03-28).
Logical, whether to load the required packages of the target.
Logical, whether to run the target script file
(default: _targets.R
) to load user-defined
global object dependencies into envir
. If TRUE
, then envir
should either be the global environment or inherit from the
global environment.
Positive integer. Each line of the traceback is shortened to this number of characters.
Character of length 1, path to the
targets
data store. Defaults to tar_config_get("store")
,
which in turn defaults to _targets/
.
When you set this argument, the value of tar_config_get("store")
is temporarily changed for the current function call.
See tar_config_get()
and tar_config_set()
for details
about how to set the data store path persistently
for a project.
Character vector, the traceback of a failed target if it exists.
Other debug:
tar_load_globals()
,
tar_workspaces()
,
tar_workspace()
# NOT RUN {
if (identical(Sys.getenv("TAR_EXAMPLES"), "true")) {
tar_dir({ # tar_dir() runs code from a temporary directory.
tmp <- sample(1)
tar_script({
tar_option_set(workspace_on_error = TRUE)
list(
tar_target(x, "loaded"),
tar_target(y, stop(x))
)
}, ask = FALSE)
try(tar_make())
tar_traceback(y, characters = 60)
})
}
# }
Run the code above in your browser using DataLab