if (FALSE) {
isolate_example("contain side effects", {
plan <- drake_plan(
large_data_1 = sample.int(1e4),
large_data_2 = sample.int(1e4),
subset = c(large_data_1[seq_len(10)], large_data_2[seq_len(10)]),
summary = {
print(ls(envir = parent.env(drake_envir())))
# We don't need the large_data_* targets in memory anymore.
rm(large_data_1, large_data_2, envir = drake_envir("targets"))
print(ls(envir = drake_envir("targets")))
mean(subset)
}
)
make(plan, cache = storr::storr_environment(), session_info = FALSE)
})
}
Run the code above in your browser using DataLab