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 your_target
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 tar_path()
with no arguments while target x
is running, the name
argument defaults to the name of the running target,
so tar_path()
returns _targets/objects/x
.
For cloud-backed formats, tar_path()
returns the
path to the staging file in _targets/scratch/
.
That way, even if you select a cloud repository
(e.g. tar_target(..., repository = "aws", storage = "none")
)
then you can still manually write to tar_path(create_dir = TRUE)
and the targets
package will automatically hash it and
upload it to the AWS S3 bucket. This does not apply to
format = "file"
, where you would never need storage = "none"
anyway.