Skip to content

selectively using statically generated branches #324

Closed Answered by wlandau
kevin-m-kent asked this question in Help
Discussion options

You must be logged in to vote

If you want to select some dynamic branches just for testing purposes initially, then the alternative patterns at https://books.ropensci.org/targets/dynamic.html#pattern-construction like head() or sample() might help. For static branching, you can first generate some target objects with tar_map() or tar_eval(), check the names, and then mention them in downstream commands. Another round of tar_eval() or tar_map() can select the targets you need.

library(targets)
tar_script({
  library(tarchetypes)
  first_targets <- tar_map(tar_target(first, f(x)), values = list(x = letters[1:5]))
  selected_first_targets <- rlang::syms(c("first_a", "first_d"))
  downstream_targets <- tar_map(
    tar_ta…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@kevin-m-kent
Comment options

Comment options

You must be logged in to vote
2 replies
@kevin-m-kent
Comment options

@wlandau
Comment options

Answer selected by kevin-m-kent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants