View source: R/drake_plan_helpers.R
drake_plan_source | R Documentation |
drake
plan
You supply a plan, and drake_plan_source()
supplies code to generate that plan. If you have the
prettycode
package,
installed, you also get nice syntax highlighting in the console
when you print it.
drake_plan_source(plan)
plan |
A workflow plan data frame (see |
a character vector of lines of text. This text
is a call to drake_plan()
that produces the plan you provide.
drake_plan()
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.
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.