-
Notifications
You must be signed in to change notification settings - Fork 0
/
_targets.R
55 lines (34 loc) · 1.3 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
# Targets -----------------------------------------------------------------
# Alec L. Robitaille ------------------------------------------------------
# Source ------------------------------------------------------------------
lapply(dir('R', '*.R', full.names = TRUE), source)
# targets-issa
raw_repo_path <- 'https://raw.githubusercontent.com/robitalec/targets-issa/'
grab_functions(raw_repo_path)
# Targets: targets-issa ---------------------------------------------------
source('https://raw.githubusercontent.com/robitalec/targets-issa/main/_targets.R')
# Targets: book -----------------------------------------------------------
targets_book <- c(
tar_target(
generate_bib,
write_bib(c(.packages(), 'bookdown', 'knitr', 'rmarkdown'), 'packages.bib')
),
tar_target_raw(
'book',
command = quote({
bookdown::render_book('index.Rmd', output_dir = 'docs')
'docs/index.html'
}),
format = 'file',
deps = c(dir('.', '.Rmd'), tar_knitr_deps(dir('.', '.Rmd'))),
cue = tar_cue('always')
)
# tar_knit(
# book,
# 'index.Rmd'
# # {generate_bib; render_book('index.Rmd', output_dir = 'docs')}
# )
)
# Targets: all ------------------------------------------------------------
# Automatically grab and combine all the "targets_*" lists above
lapply(grep('targets', ls(), value = TRUE), get)