-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_targets.R
66 lines (53 loc) · 1.45 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
################################################################################
#
# Project build script
#
################################################################################
# Load packages (in packages.R) and load project-specific functions in R folder
suppressPackageStartupMessages(source("packages.R"))
for (f in list.files(here::here("R"), full.names = TRUE)) source (f)
# Set build options ------------------------------------------------------------
# Groups of targets ------------------------------------------------------------
## Form/questionnaire development
xlsform_setup <- tar_plan(
## Download endline xlsform from googledrive
tar_target(
name = xlsform_file,
command = download_googledrive(
filename = "sofala_s3m",
path = "forms/sofala_s3m.xlsx",
overwrite = TRUE
) |>
(\(x) x[["local_path"]])(),
format = "file"
),
ona_project_id = okapi::ona_project_list() |>
subset(name == "Sofala S3M") |>
(\(x) x[["projectid"]])(),
ona_form_published = okapi::ona_form_publish(
xls_file = xlsform_file,
project_id = ona_project_id,
public = TRUE
)
)
## Read associated text and code information
codebook <- tar_plan(
##
)
## Outputs
outputs <- tar_plan(
##
)
## Deploy targets
deploy <- tar_plan(
##
)
## Set seed
set.seed(1977)
# Concatenate targets ----------------------------------------------------------
list(
xlsform_setup,
codebook,
outputs,
deploy
)