-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_targets.R
79 lines (64 loc) · 1.86 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
67
68
69
70
71
72
73
74
75
76
77
78
79
cat("_targets.R\n")
# Here I'm interested in the github actions and docker deployment workflows.
# So, I used and updated the code from https://www.brodrigues.co/blog/2022-11-19-raps/ by @b-rodrigues
# An example can also be seen here https://github.com/b-rodrigues/dockerized_pipeline_demo
library(targets)
library(dplyr)
library(ggplot2)
source("functions.R")
list(
tar_target(
unemp_data,
get_data()
),
tar_target(
lux_data,
clean_unemp(unemp_data,
place_name_of_interest = "Luxembourg",
level_of_interest = "Country",
col_of_interest = active_population)
),
tar_target(
canton_data,
clean_unemp(unemp_data,
level_of_interest = "Canton",
col_of_interest = active_population)
),
tar_target(
commune_data,
clean_unemp(unemp_data,
place_name_of_interest = c("Luxembourg",
"Dippach",
"Wiltz",
"Esch/Alzette",
"Mersch"),
col_of_interest = active_population)
),
tar_target(
lux_plot,
make_plot(lux_data)
),
tar_target(
canton_plot,
make_plot(canton_data)
),
tar_target(
commune_plot,
make_plot(commune_data)
),
tar_target(
luxembourg_saved_plot,
save_plot("output/luxembourg.png", lux_plot),
format = "file"
),
tar_target(
canton_saved_plot,
save_plot("output/canton.png", canton_plot),
format = "file"
),
tar_target(
commune_saved_plot,
save_plot("output/commune.png", commune_plot),
format = "file"
)
)