View source: R/tar_path_target.R
| tar_path_target | R Documentation |
Identify the file path where the current target will be stored
locally on disk.
Designed to be called inside the command of a target currently
running in a pipeline.
See the "Value" section for specifics because the return
value depends on the format and repository settings.
tar_path_target(
name = NULL,
default = NA_character_,
create_dir = FALSE,
store = targets::tar_config_get("store")
)
name |
Symbol, name of a target.
If |
default |
Character, value to return if |
create_dir |
Logical of length 1,
whether to create |
store |
Character of length 1,
path to the data store if |
Character string, the file path where the target currently running
will be stored. This path is not always known or available in advance,
it depends on the format and repository settings.
If format is not "file" and repository is "local" (default)
then tar_path_target() returns "STORE/objects/YOUR_TARGET",
where STORE is the value of tar_config_get("store") and
YOUR_TARGET is the name of your target.
Otherwise, if format is "file", then the return value is
NA_character_ because targets does not control where
those files are stored.
Otherwise, if format is not "file" and repository is
not "local", then tar_path_target() returns
the temporary staging path where the data is stored
before it is uploaded to a remote repository.
Remote repositories vary so widely that the eventual final location
cannot always be known, but all remote repositories use staging
files that targets knows about.
If not called from inside a running target,
tar_path_target(name = your_target) just returns
"STORE/objects/your_target".
Other utilities:
tar_active(),
tar_backoff(),
tar_call(),
tar_cancel(),
tar_definition(),
tar_described_as(),
tar_envir(),
tar_format_get(),
tar_group(),
tar_name(),
tar_path(),
tar_path_script(),
tar_path_script_support(),
tar_path_store(),
tar_source(),
tar_store(),
tar_unblock_process()
tar_path_target()
tar_path_target(your_target)
if (identical(Sys.getenv("TAR_EXAMPLES"), "true")) { # for CRAN
tar_dir({ # tar_dir() runs code from a temp dir for CRAN.
tar_script(tar_target(returns_path, tar_path_target()), ask = FALSE)
tar_make()
tar_read(returns_path)
})
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.