-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path_targets.R
49 lines (40 loc) · 1.02 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
library("targets")
# Packages
source("packages.R")
# source workflow functions
R.utils::sourceDirectory("R")
tar_option_set(format = "qs")
tar_option_set(debug = "spc_tbl")
options(future.rng.onMisuse = "ignore")
future::plan(future::multisession, workers = 8L)
## Define the pipeline =========================================================
## Each target list defines distinct but related task sets of
## the pipeline. Eeach list includes targets, R objects, and a recipe
## how to build them using functions (either low-level one in package
## or workflow-specific functions contained in `.R` files in the
## folder ./R)
pip_spec_in <- list(
tar_target(
spec_in,
read_all_opus_files(
dsn = file.path("data", "spectra")
)
),
tar_target(
spec_dt,
convert_spec_list_to_dt(
spec_in
)
),
tar_target(
preproc_plan,
make_preproc_plan()
),
tar_target(
spec_proc,
specprepper::sg_apply(
X = spec_dt$.predictor_values[[1]],
dt_sg_plan = preproc_plan
)
)
)