-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMearsheimer_NATO.R
142 lines (85 loc) · 3.53 KB
/
Mearsheimer_NATO.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
##Final_Version
library(tidyverse)
library(sf)
library(rnaturalearth)
library(rnaturalearthdata)
library(rgeos)
library(visdat)
library(here)
load(here::here("data", "tidy_data", "nato_nations.rda") )
nato_nations$brk_a3 <- nato_nations$iso_a3
nato_nationsm <- nato_nations %>%
select(-country)
world <- ne_countries(scale = "large", returnclass = "sf")
EU_Map2 <- world %>% filter(region_wb == "Europe & Central Asia")
# First Graph -------------------------------------------------------------
map_one <- EU_Map2 %>%
left_join(nato_nationsm, by = "brk_a3") %>%
ggplot() +
geom_sf( aes(fill = joined_NATO)) +
coord_sf(xlim = c(-27,52), ylim = c(33,72), expand = TRUE)
map_one <- map_one +
labs(fill = "Year", title = "European NATO Alliance: 2022",
x = "", y = "",
caption = "Data Humanist, CC0 (Public Domain)" ) +
annotate("text", x = 40, y = 54, label = "Russia") +
annotate("text", x = 27.8, y = 53.2, label = "Belarus") +
annotate("text", x = 31, y = 49.5, label = "Ukraine")
map_one
# Map Two -----------------------------------------------------------------
wpact <- c("1949", "1952", "1955", "1982")
warsaw_pact <- nato_nationsm %>%
filter(joined_NATO %in% wpact ) %>% droplevels()
post_pact <- nato_nationsm %>%
filter(!joined_NATO %in% wpact ) %>% droplevels()
##
##
map_two <- EU_Map2 %>%
left_join(warsaw_pact , by = "brk_a3") %>%
ggplot() +
geom_sf( aes(fill = joined_NATO)) +
coord_sf(xlim = c(-27,52), ylim = c(33,72), expand = TRUE)
map_two <- map_two +
labs(fill = "Year",
title = "European NATO Alliance: Warsaw Pact Years",
x = "", y = "", caption = "Data Humanist, CC0 (Public Domain)" ) +
annotate("text", x = 40, y = 54, label = "Russia") +
annotate("text", x = 27.8, y = 53.2, label = "Belarus") +
annotate("text", x = 31, y = 49.5, label = "Ukraine")
map_two
# Map Three ---------------------------------------------------------------
map_three <- EU_Map2 %>%
left_join(post_pact , by = "brk_a3") %>%
ggplot() +
geom_sf( aes(fill = joined_NATO)) +
coord_sf(xlim = c(-27,52), ylim = c(33,72), expand = TRUE)
map_three <- map_three +
labs(fill = "Year",
title = "European NATO Expansion: Post-Warsaw Pact",
x = "", y = "",
caption = "Data Humanist, CC0 (Public Domain)" ) +
annotate("text", x = 40, y = 54, label = "Russia") +
annotate("text", x = 27.8, y = 53.2, label = "Belarus") +
annotate("text", x = 31, y = 49.5, label = "Ukraine")
map_three
# Map Four ---------------------------------------------------------------
ukr_nato <- nato_nationsm %>%
mutate(NATO = case_when(iso_a3 == "UKR" ~ 1,
TRUE ~ NATO) ) %>%
mutate(enemy = case_when(NATO == 1 ~ "YES",
TRUE ~ NA_character_) )
map_four <- EU_Map2 %>%
left_join(ukr_nato , by = "brk_a3") %>%
ggplot() +
geom_sf( aes(fill = enemy)) +
coord_sf(xlim = c(-27,52), ylim = c(33,72), expand = TRUE)
map_four <- map_four +
labs(fill = "Year", title = "If Ukraine Flipped to NATO ...",
x = "", y = "",
caption = "Data Humanist, CC0 (Public Domain)" ) +
annotate("text", x = 27.8, y = 53.2, label = "Belarus") +
annotate("text", x = 31, y = 49.5, label = "Ukraine") +
annotate("text", x = 43, y = 55,
label = "Russia:\n indefensible \nwestern\n borders\n ") +
guides(fill = "none") + scale_fill_manual(values = "red" )
map_four