generated from OxfordIHTM/ihtm-targets-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
_targets_forecasts.R
88 lines (71 loc) · 2.38 KB
/
_targets_forecasts.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
################################################################################
#
# Targets workflow for forecasts data download, extraction, and processing
#
################################################################################
## Download targets ------------------------------------------------------------
forecasts_download_targets <- tar_plan(
### Set PAGASA forecasts pubfiles URL ----
tar_target(
name = forecasts_pubfiles_urls,
command = forecasts_create_urls()
),
### Download PAGASA forecasts PDF ----
tar_target(
name = forecasts_download_files,
command = forecasts_download(
.url = forecasts_pubfiles_urls,
directory = "data-raw/forecasts",
overwrite = FALSE
),
pattern = map(forecasts_pubfiles_urls),
format = "file"
),
### Download PAGASA agriculture forecasts PDF ----
tar_target(
name = forecasts_agriculture_download_files,
command = forecasts_agriculture_download(),
format = "file",
cue = tar_cue("always")
)
)
## Data targets ----------------------------------------------------------------
forecasts_data_targets <- tar_plan(
### List PAGASA forecasts data files ----
tar_target(
name = forecasts_archive_pdfs,
command = list.files(
path = "data-raw/forecasts", full.names = TRUE, recursive = TRUE
),
cue = tar_cue("always")
),
### Extract raw PAGASA forecasts data ----
tar_target(
name = forecasts_data_raw,
command = forecasts_get_data(forecasts_archive_pdfs),
pattern = map(forecasts_archive_pdfs)
),
### List PAGASA agriculture forecasts data files ----
tar_target(
name = forecasts_agriculture_archive_pdfs,
command = list.files(
path = "data-raw/forecasts_agriculture",
full.names = TRUE, recursive = TRUE
)
)
)
## Processing targets ----------------------------------------------------------
forecasts_processing_targets <- tar_plan(
)
## Analysis targets ------------------------------------------------------------
forecasts_analysis_targets <- tar_plan(
)
## Output targets --------------------------------------------------------------
forecasts_output_targets <- tar_plan(
)
## Reporting targets -----------------------------------------------------------
forecasts_report_targets <- tar_plan(
)
## Deploy targets --------------------------------------------------------------
forecasts_deploy_targets <- tar_plan(
)