Skip to content

Move through targets finishing each branch before starting a new one #437

Closed Answered by wlandau
gorkang asked this question in Help
Discussion options

You must be logged in to vote

In your case, it would probably be easiest to change the memory management strategy, e.g. tar_option_set(memory = "transient", garbage_collection = TRUE). If you did that, I suspect target execution order would matter less. (Please keep in mind that targets assumes each target produces a single serializable/exportable return value and any untracked side effects can be safely discarded.)

An alternative would be to manually set the priority of each target. It is difficult to do this in tar_map() but may be easier with tar_eval().

# _targets.R
library(rlang)
library(targets)
library(tarchetypes)
tar_eval(
  values = list(
    target1 = c("target1_a", "target1_b"),
    target2 = c("target2_a", "

Replies: 3 comments 9 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by gorkang
Comment options

You must be logged in to vote
1 reply
@wlandau
Comment options

Comment options

You must be logged in to vote
8 replies
@wlandau
Comment options

@gorkang
Comment options

@wlandau
Comment options

@wlandau
Comment options

@gorkang
Comment options

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