-
Help
DescriptionPlease ask your question and provide a reprex if troubleshooting. For example: # with issues
targets::tar_dir({
targets::tar_script({
library(targets)
list(
tar_target(x, 1),
tar_target(y, 2),
tarchetypes::tar_eval(
tar_target(name, list(val)),
values = tibble::tribble(
~name, ~val,
rlang::sym("t"), rlang::syms(c("x", "y"))
)
)
)
})
targets::tar_visnetwork()
}) The dependency between For now I can use # workaround?
targets::tar_dir({
targets::tar_script({
library(targets)
list(
tar_target(x, 1),
tar_target(y, 2),
tarchetypes::tar_map(
values = tibble::tribble(
~name, ~val,
rlang::sym("t"), rlang::syms(c("x", "y"))
),
names = name,
tar_target(
tar_name, val
)
)
)
})
targets::tar_visnetwork()
}) Is this by design? The |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
# _targets.R
library(targets)
list(
tar_target(x, 1),
tar_target(y, 2),
tarchetypes::tar_eval(
tar_target(name, list(val)),
values = tibble::tribble(
~name, ~val,
quote(t), quote(list(x, y))
)
)
) |
Beta Was this translation helpful? Give feedback.
substitute(list(x), env = list(x = rlang::syms(list("y", "z"))))
andsubstitute(list(x), env = list(x = quote(list(y, z))))
may look the same when you print them, but the returned objects are actually very different. The former has a non-language list object in place ofx
, whereas the latter is a better language object with true language objects at every level of the abstract syntax tree.tar_eval()
is built onsubstitute()
, so it works the same way. The following_targets.R
file does what you want.