Replies: 2 comments 3 replies
-
I think I understand a bit more now. tar_map can be used in a factory if tar_target_raw is used inside the tar_map call. |
Beta Was this translation helpful? Give feedback.
-
I have a follow-up question for this scenario: targets::tar_script({
target_fty <- function( .values_tgt ){
tarchetypes::tar_map(
values = .values_tgt,
names = id,
targets::tar_target_raw("results",quote(x+y))
)
}
list(
tar_target(
values_tgt,
list(id = c("a","b","c"),x=quote(c(1,2,3)),y=quote(c(4,5,6)))
),
target_fty( .values_tgt=values_tgt )
)
})
targets::tar_manifest()
#> Error:
#> ! Error running targets::tar_manifest()
#> Error messages: targets::tar_meta(fields = error, complete_only = TRUE)
#> Debugging guide: https://books.ropensci.org/targets/debugging.html
#> How to ask for help: https://books.ropensci.org/targets/help.html
#> Last error: object 'values_tgt' not found
#> Backtrace:
#> ▆
#> 1. └─targets::tar_manifest()
#> 2. └─targets:::callr_outer(...)
#> 3. ├─targets:::if_any(...)
#> 4. └─targets:::callr_error(condition = out, fun = fun)
#> 5. └─targets::tar_throw_run(message, class = class(condition))
#> 6. └─targets::tar_error(...)
#> 7. └─rlang::abort(message = message, class = class, call = tar_empty_envir) Created on 2023-08-31 with reprex v2.0.2 I just don't get it this object transmission meta-programmed. Many thanks! |
Beta Was this translation helpful? Give feedback.
-
I would like to use tar_map in a target factory so I think I need a "raw" version of the function.
I see
tar_map2_raw
as well astar_map_rep_raw
but notar_map_raw
.Can
tar_map
be used in a target factory?Beta Was this translation helpful? Give feedback.
All reactions