-
Help
DescriptionA simple example: targets::tar_dir({
targets::tar_script({
library(targets)
targets <- tarchetypes::tar_map(
values = data.frame(x = 1:2),
list(
tarchetypes::tar_age(
test, x,
age = as.difftime(1, units = "days")
)
)
)
list(
targets,
tarchetypes::tar_age(x, 1, age = as.difftime(1, units = "days"))
)
})
targets::tar_make()
targets::tar_make()
})
#> • start target x
#> • built target x [0 seconds]
#> • start target test_1
#> • built target test_1 [0 seconds]
#> • start target test_2
#> • built target test_2 [0 seconds]
#> • end pipeline [0.08 seconds]
#> ✔ skip target x
#> • start target test_1
#> • built target test_1 [0 seconds]
#> • start target test_2
#> • built target test_2 [0 seconds]
#> • end pipeline [0.11 seconds] Created on 2023-05-09 with reprex v2.0.2 |
Beta Was this translation helpful? Give feedback.
Answered by
wlandau
May 9, 2023
Replies: 1 comment 3 replies
-
|
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
psychelzh
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
tar_age()
usestar_cue_age_raw()
to create the cue, and this cue is specific to the original target object with the original name before mapping occurs.tar_map()
does not update cues, sotar_eval()
would be a better fit for this case: https://books.ropensci.org/targets/static.html#metaprogramming