-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_targets.R
31 lines (28 loc) · 865 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
setwd('~/MirjamHoekstra')
suppressPackageStartupMessages(library(dplyr))
source('~/MirjamHoekstra/R/targets_init.R')
source('~/MirjamHoekstra/R/init.R')
if (F) {
ls(pattern = '_targets$', targets_env) %>%
purrr::map(~get(.x, env = targets_env)) %>%
unlist(recursive = F) %>%
{ .[which(map_lgl(., ~!'tar_stem' %in% class(.x)))] } %>%
{ . }
}
## All objects ending with _targets are assumed to contained
## tar_target objects or lists thereof
# ls(pattern = '.*', targets_env)
# targets_env$NH_M_targets_K
ls(pattern = '_targets$', targets_env) %>%
setdiff(c(
'combined_experiment_targets',
'exp_groupings',
'ML_targets',
NULL
)) %>%
purrr::map(~get(.x, env = targets_env)) %>%
purrr::discard(is.null) %>%
tarchetypes::tar_hook_outer(
hook = { source('~/MirjamHoekstra/R/init.R'); .x },
names = everything()
)