Does anyone have an example of how to use static branching from the targets package (R)? I'm reading targets manual on static branching but I'm having a hard time understanding it (even though I do get dynamic branching).
targets::tar_map() example? (R targets static branching)
Asked Answered
Here's an example _targets.R
very similar to a project I have:
library(targets)
library(tarchetypes)
library(dplyr)
params <- tribble(
~name, ~arg1, ~arg2,
"A", "a", 1,
"B", "b", 2,
"C", "c", 3
)
mapped_pipeline <- tar_map(
values = params,
names = "name",
tar_target(first_target,
f(arg1, arg2)),
tar_target(second_target,
g(first_target)
)
)
tar_pipeline(pipeline)
© 2022 - 2024 — McMap. All rights reserved.