generated from OxfordIHTM/ihtm-targets-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
_targets_climate.R
90 lines (75 loc) · 2.43 KB
/
_targets_climate.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
89
90
################################################################################
#
# Targets workflow for climate data download, extraction, and processing
#
################################################################################
## Download targets ------------------------------------------------------------
climate_download_targets <- tar_plan(
### Set PAGASA climate pubfiles URL ----
tar_target(
name = climate_pubfiles_url,
command = "https://pubfiles.pagasa.dost.gov.ph/pagasaweb/files/cad/"
),
### Get directories links ----
tar_target(
name = climate_directory_urls,
command = climate_get_pdf_directory_urls(climate_pubfiles_url)
),
### Get PDF download links ----
tar_target(
name = climate_pdf_urls,
command = climate_get_pdf_urls(climate_directory_urls),
pattern = map(climate_directory_urls)
),
### Download climate data ----
tar_target(
name = climate_download_files,
command = climate_download_pdfs(
pdf_url = climate_pdf_urls,
directory = "data-raw",
overwrite = FALSE
),
pattern = map(climate_pdf_urls),
format = "file",
error = "continue"
)
)
## Processing targets ----------------------------------------------------------
climate_processing_targets <- tar_plan(
tar_target(
name = pagasa_weather_stations,
command = get_weather_station_info(climate_download_files)
),
tar_target(
name = climate_data_normals_1991_2020,
command = climate_process_1991(climate_download_files)
),
tar_target(
name = climate_data_extremes_2020,
command = climate_process_2020(climate_download_files)
),
tar_target(
name = climate_data_extremes_2021,
command = climate_process_2021(climate_download_files)
),
tar_target(
name = climate_data_extremes_2022,
command = climate_process_2022(climate_download_files)
),
tar_target(
name = climate_data_extremes_2023,
command = climate_process_2023(climate_download_files)
)
)
## Analysis targets ------------------------------------------------------------
climate_analysis_targets <- tar_plan(
)
## Output targets --------------------------------------------------------------
climate_output_targets <- tar_plan(
)
## Reporting targets -----------------------------------------------------------
climate_report_targets <- tar_plan(
)
## Deploy targets --------------------------------------------------------------
climate_deploy_targets <- tar_plan(
)