Replies: 1 comment
-
Yes, static branching with target objects is an adjustment. But unfortunately, the functionality in # _targets.R
library(targets)
library(tarchetypes)
ecafs <- tar_map(
values = data.table(
as_at = as.character(quarters$as_at),
start = as.character(quarters$start),
end = as.character(quarters$end),
year = as.character(quarters$year),
quarter = as.character(quarters$quarter),
names_ = paste(quarters$year, quarters$quarter, sep = '_')
),
names = 'names_',
tar_target(
ecaf,
ecaf_fn(
as_at_ = as_at,
start_ = start,
end_ = end,
year_ = year,
quarter_ = quarter
)
)
)
combined <- tar_combine(ecaf_combined, ecafs)
list(ecafs, combined) Correct use with # _targets.R
library(targets)
library(tarchetypes)
ecafs <- tar_map(
values = data.table(
as_at = as.character(quarters$as_at),
start = as.character(quarters$start),
end = as.character(quarters$end),
year = as.character(quarters$year),
quarter = as.character(quarters$quarter),
names_ = paste(quarters$year, quarters$quarter, sep = '_')
),
names = 'names_',
tar_target(
ecaf,
ecaf_fn(
as_at_ = as_at,
start_ = start,
end_ = end,
year_ = year,
quarter_ = quarter
)
)
)
combined <- tar_combine(ecaf_combined, ecafs)
tar_plan(ecafs, combined) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I have just recently switched from drake to targets and I'm finding the use of target objects in the global environment alongside the names argument inside the target() function confusing.
I'm trying to use the tar_plan() to try to overcome this, If I don't assign my tar_map() to an object called 'ecafs' and instead try to combine 'ecaf' as defined in the tar_target() nested inside the tar_map() it doesn't know it exists. Any advice would be much appreciated.
Beta Was this translation helpful? Give feedback.
All reactions