Replies: 1 comment
-
You could write a target like this: tar_target(
files, {
system2("./your_script.sh")
c("your_script.sh", "output_file1.csv", "output_file2.csv"),
format = "file"
}
) File targets are documented at https://books.ropensci.org/targets/files.html#external-input-files and https://books.ropensci.org/targets/files.html#external-output-files. A little redundancy for file tracking is not usually a problem, but if the script only downloads the data if the file does not already exist, it may fail to download the most up-to-date versions of those files. Likewise with ordinary file targets. So maybe consider |
Beta Was this translation helpful? Give feedback.
-
I have a workflow that starts with downloading climate data using a shell script. The shell script checks whether the data exists already, verifies the checksum, and then only downloads the data if it doesn't already exist. That script downloads many files. I'm not sure how to include that in a
targets
workflow. I can write an R wrapper to run the script, but since it already checks if the files are outdated, would it even make sense to try to include it intar_plan()
? Should I just put that wrapper function in_targets.R
, but outside oftar_plan()
?Beta Was this translation helpful? Give feedback.
All reactions