tar_dir({ # tar_dir() runs code from a temp dir for CRAN.
tar_script() # Writes an example target script file.
# Writes a user-defined target script:
tar_script({
library(targets)
library(tarchetypes)
x <- tar_target(x, 1 + 1)
tar_option_set()
list(x)
}, ask = FALSE)
writeLines(readLines("_targets.R"))
})
Run the code above in your browser using DataLab