if (FALSE) {
isolate_example("Quarantine side effects.", {
if (suppressWarnings(require("knitr"))) {
load_mtcars_example() # Get the code with drake_example("mtcars").
make(my_plan) # Run the project, build the targets.
known_times <- rep(7200, nrow(my_plan))
names(known_times) <- my_plan$target
known_times
# Predict the runtime
if (requireNamespace("lubridate", quietly = TRUE)) {
predict_runtime(
my_plan,
jobs_predict = 7L,
from_scratch = TRUE,
known_times = known_times
)
predict_runtime(
my_plan,
jobs_predict = 8L,
from_scratch = TRUE,
known_times = known_times
)
balance <- predict_workers(
my_plan,
jobs_predict = 7L,
from_scratch = TRUE,
known_times = known_times
)
balance
}
}
})
}
Run the code above in your browser using DataLab