-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsample_scripts.R
More file actions
59 lines (41 loc) · 1.19 KB
/
sample_scripts.R
File metadata and controls
59 lines (41 loc) · 1.19 KB
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
library(tidyverse)
devtools::load_all(".")
# Sharepoint drive
save_path <- "GDI Country Data Snapshot/Snapshots"
# Render all --------------------------------------------------------------
regions <- c(
"Americas and Caribbean",
"Asia and the Pacific",
"East, Horn and Southern Africa",
"Europe and Central Asia",
"Middle East and North Africa",
"West and Central Africa"
)
for (region in regions) {
countries <- gdidata::countrynames |>
filter(iom_region == region, snapshot == 1) |>
pull(iso3)
for (country in countries) {
render_snapshot(
country,
target_dir = file.path(save_path, region)
)
}
}
# Render by region --------------------------------------------------------
region_select <- regions[4]
countries <- gdidata::countrynames |>
dplyr::filter(iom_region == region_select, snapshot == 1) |>
pull(iso3)
for (country in countries[20:55]) {
render_snapshot(
country,
target_dir = file.path(save_path, region_select)
)
}
# Test select countries ---------------------------------------------------
test_countries <- c("GNQ", "TCD")
for (country in test_countries) {
render_snapshot(country)
}
render_snapshot("ITA")