plan <- drake::drake_plan(
small_data = download_data("https://some_website.com"),
large_data_raw = target(
command = download_data("https://lots_of_data.com"),
trigger = trigger(
change = time_last_modified("https://lots_of_data.com"),
command = FALSE,
depend = FALSE
),
timeout = 1e3
)
)
print(plan)
if (requireNamespace("styler", quietly = TRUE)) {
source <- drake_plan_source(plan)
print(source) # Install the prettycode package for syntax highlighting.
file <- tempfile() # Path to an R script to contain the drake_plan() call.
writeLines(source, file) # Save the code to an R script.
}
Run the code above in your browser using DataLab