# NOT RUN {
# Workflow plan for datasets:
x_plan <- evaluate_plan(
drake_plan(x = VALUE),
wildcard = "VALUE",
values = 1:8
)
# Create a new target from the sum of the others.
reduce_plan(x_plan, target = "x_sum", pairwise = FALSE)
# For memory efficiency and parallel computing,
# reduce pairwise:
reduce_plan(x_plan, target = "x_sum", pairwise = TRUE)
# Optionally define your own function and use it as the
# binary operator in the reduction.
x_plan <- evaluate_plan(
drake_plan(x = VALUE),
wildcard = "VALUE",
values = 1:9
)
x_plan
reduce_plan(
x_plan, target = "x_sum", pairwise = TRUE,
begin = "fun(", op = ", ", end = ")"
)
# }
Run the code above in your browser using DataLab