-
Notifications
You must be signed in to change notification settings - Fork 0
/
_targets.R
49 lines (34 loc) · 1.44 KB
/
_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
# === Targets -------------------------------------------------------------
# Alec L. Robitaille
# Source ------------------------------------------------------------------
lapply(dir('R', '*.R', full.names = TRUE), source)
# Options -----------------------------------------------------------------
# Targets
tar_option_set(format = 'qs')
# Stan
options(mc.cores = 2,
scipen = 999,
digits = 2)
# Variables ---------------------------------------------------------------
# Stan model, compiled dir
model_dir_stan <- file.path('stan')
compiled_dir <- file.path('stan', 'compiled')
output_stan_dir <- file.path('stan', 'output')
stan_files <- dir(model_dir_stan, '.stan', full.names = TRUE)
# cpp_options = list(stan_threads = TRUE),
# chains = 4,
# quiet = FALSE,
# parallel_chains = 4,
# threads_per_chain = 4,
# dir = compiled_dir,
# output_dir = output_stan_dir
# Homework ----------------------------------------------------------------
source(file.path('homework', '02-homework-targets.R'))
source(file.path('homework', '03-homework-targets.R'))
source(file.path('homework', '04-homework-targets.R'))
source(file.path('homework', '05-homework-targets.R'))
source(file.path('homework', '06-homework-targets.R'))
source(file.path('homework', '07-homework-targets.R'))
# Targets: all ------------------------------------------------------------
# Automatically grab all the "targets_*" lists above
lapply(grep('targets', ls(), value = TRUE), get)