-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_targets.R
49 lines (45 loc) · 901 Bytes
/
_targets.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
library(targets)
controller <- crew::crew_controller_local(
workers = future::availableCores() - 1,
seconds_idle = 3
)
# Set target options:
tar_option_set(
packages = c("logger"),
format = "qs",
controller = controller,
garbage_collection = TRUE,
memory = "transient",
iteration = "vector"
)
source("R/log-utils.R")
list(
tar_target(
set_log, {
set_logger("_targets.log", overwrite = TRUE)
TRUE
}
),
tar_target(
test_log_directly, {
set_log # Establish dependency
logger::log_info("{Sys.time()} this is a single log!")
}
),
tar_target(
branches,
{
1:10
}
),
# Uncomment this target to reproduce the bug
# tar_target(
# test_log_with_branching,
# test_logger(set_log, i=branches),
# pattern = map(branches)
# ),
tar_target(
test_log_without_branching,
test_logger(set_log, i=1)
)
)