generated from OxfordIHTM/ihtm-targets-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_targets_cyclones.R
80 lines (61 loc) · 1.95 KB
/
_targets_cyclones.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
################################################################################
#
# General Targets Workflow
#
################################################################################
## Download targets ------------------------------------------------------------
cyclones_download_targets <- tar_plan(
### Get download links ----
tar_target(
name = cyclone_reports_links,
command = cyclones_get_report_links(),
cue = tar_cue("always")
),
### Download reports ----
tar_target(
name = cyclone_reports_download_files,
command = cyclones_download_report(
url_link = cyclone_reports_links,
directory = "data-raw"
),
pattern = map(cyclone_reports_links),
format = "file"
)
)
## Data targets ----------------------------------------------------------------
cyclones_data_targets <- tar_plan(
### Process cyclones peak data ----
tar_target(
name = cyclones_peak_data,
command = cyclones_process_peak_data(
path_to_report = cyclone_reports_download_files
),
pattern = map(cyclone_reports_download_files)
),
### Output cyclones peak data as CSV ----
tar_target(
name = cyclones_peak_data_csv,
command = {
write.csv(
cyclones_peak_data, file = "data/cyclones.csv", row.names = FALSE
)
"data/cyclones.csv"
},
format = "file"
)
)
## Processing targets ----------------------------------------------------------
cyclones_processing_targets <- tar_plan(
)
## Analysis targets ------------------------------------------------------------
cyclones_analysis_targets <- tar_plan(
)
## Output targets --------------------------------------------------------------
cyclones_output_targets <- tar_plan(
)
## Reporting targets -----------------------------------------------------------
cycylones_report_targets <- tar_plan(
)
## Deploy targets --------------------------------------------------------------
cyclones_deploy_targets <- tar_plan(
)