# NOT RUN {
if (identical(Sys.getenv("TAR_EXAMPLES"), "true")) {
tar_dir({ # tar_dir() runs code from a temporary directory.
tar_script({
tar_option_set(packages = "callr")
analyze_data <- function(data) {
summary(data)
}
list(
tar_target(x, 1 + 1),
tar_target(y, 1 + 1)
)
}, ask = FALSE)
tar_load_globals()
print(analyze_data)
print("callr" %in% (.packages()))
})
}
# }
Run the code above in your browser using DataLab