Identify the file path where a target will be stored after the target finishes running in the pipeline.
tar_path( name = NULL, default = NA_character_, create_dir = FALSE, store = targets::tar_config_get("store") )
Symbol, name of a target.
Character, value to return if
Logical of length 1,
whether to create
Character of length 1, path to the
Character, file path of the return value of the target.
If not called from inside a running target,
tar_path(name = your_target) just returns
_targets/objects/your_target, the file path where
will be saved unless
format is equal to
"file" or any of the
supported cloud-based storage formats.
For non-cloud storage formats, if you call
with no arguments while target
x is running, the
argument defaults to the name of the running target,
For cloud-backed formats,
tar_path() returns the
path to the staging file in
That way, even if you select a cloud format
tar_target(..., format = "aws_parquet", storage = "none"))
then you can still manually write to
tar_path(create_dir = TRUE)
targets package will automatically hash it and
upload it to the AWS S3 bucket. This does not apply to formats
"aws_file", where you would never need
storage = "none"
tar_path()#>  NAtar_path(your_target)#>  "_targets/objects/your_target"