forked from ClioGMU/clio2-mapping
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmapping-sinking_data.Rmd
342 lines (291 loc) · 14.3 KB
/
mapping-sinking_data.Rmd
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
---
title: "Mapping Assignment"
author: "Brandan P. Buck"
date: "6 Apr 2019"
output: html_document
---
```{r, include=FALSE}
library(dplyr)
library(tidyverse)
library(leaflet)
library(sf)
library(maps)
library(mapdata)
sinking_data<- read_csv("C:/Users/bpbuc/Documents/Brandan's Stuff/_PhD Stuff/CILO II/project_data/sinking_data/japanese_merchant_fleet_sinkings_simplified_v4.csv")
sloc<- read_sf("C:/Users/bpbuc/Documents/Brandan's Stuff/_PhD Stuff/Cilo Wired-Hist 696/Project/Data/SLOC/Japanese SLOC WWII Complete.shp")
```
For this assignment I revisited the sinking data that I intend to use for the final project. I could not figure out how to use ggplot to build static maps since the data I am using already has geocoords. Also, since these events occur on the ocean, I don’t have a polygon shapefile to use as a baselayer in a choropleth map. Therefore, I made two leaf maps, one depicting mass causality events and the other the all sinking events from May 1945 until the end of the war, chief among them being the mining operation known as Operation Starvation.
```{r}
dms2dd <- function(x) {
deg <- str_extract(x, "\\d+") %>% as.numeric()
min <- str_extract(x, "-\\d+") %>% str_remove("-") %>% as.numeric()
deg <- deg + min / 60
dir <- str_extract(x, "\\w$")
ifelse(dir %in% c("N", "E"),
deg,
-deg)}
sinking_data_dd<- sinking_data %>%
mutate(lat= dms2dd(loc_1),
lon= dms2dd(loc_2))
sinking_data$date<-as.Date(sinking_data$date, '%Y-%m-%d')
pal <- colorFactor(c("red", "green", "blue", "purple"), domain = c("aircraft", "mine", "submarine", "surface_craft"))
sinking_data_dd_42 <-sinking_data_dd %>%
drop_na(cas_est) %>%
filter(year == 1942) %>%
filter(cas_est > 150)
sinking_data_dd_43 <-sinking_data_dd %>%
drop_na(cas_est) %>%
filter(year == 1943) %>%
filter(cas_est > 150)
sinking_data_dd_44 <-sinking_data_dd %>%
drop_na(cas_est) %>%
filter(year == 1944) %>%
filter(cas_est > 150)
sinking_data_dd_45 <-sinking_data_dd %>%
drop_na(cas_est) %>%
filter(year == 1945) %>%
filter(cas_est > 150)
sinking_data_dd_cas_est<- sinking_data_dd %>%
drop_na(cas_est) %>%
filter(cas_est > 150)
downfall_sub<- sinking_data_dd %>%
filter(date > "1945-04-30",
sinking_agent == "submarine")
downfall_mine<- sinking_data_dd %>%
filter(date > "1945-04-30",
sinking_agent == "mine")
downfall_aircraft<- sinking_data_dd %>%
filter(date > "1945-04-30",
sinking_agent == "aircraft")
downfall<- sinking_data_dd %>%
filter(date > "1945-04-30")
```
This is an interactive map showing all vessels with known casualty estimates over 150. The circles have been colored to indicate sinking agent, blue for submarines, red for aircraft, green for mines and purple for surface craft. A cursory look at the data shows that sinkings via submarines constituted an overwhelming number of mass causality sinkings, 84 for subs, 19 for aircraft and two each for surface vessels and mines. These mass casualty events constituted 127,941 estimated causalities, 84% of the estimated loss of life during the Allied campaign to sink the Japanese merchant fleet.
The largest number of these events clustered between the island of Luzon and Taiwan. Examining each event also shows at the number of mass causality events occurred during predominately in 1944. These high casualty events occurred because as the Japanese merchant fleet moved Allied POWs towards the interior of the empire and Japanese to the periphery to defend against Allied advances. Several, isolated vessels were sunk my U.S. submarines in the waters south of Japan between Okinawa and Iwo Jima.
U.S. submarines sunk cluster of vessels which resulted in mass causality events south of the Japanese island of Kyushu and in the China Sea. These events occurred when only Allied submarines (almost exclusively U.S. boats) were capable of sinking Japanese merchant vessels in vicinity of the Japanese home islands.
This amended dataset displays the same spatial pattern as the larger one, submarine sinkings constituted a war of attrition clustered in, but not limited to the South China Sea. Aircraft however mass their assaults on major ports and shipping nodes. Port facilities on the coral atoll of Truk and southern Taiwan depict this pattern prominently. Similarly, Allied submarines, as one may expect had the longest reach throughout war. Conversely, Allied aircraft played a larger role, later in the war as larger carrier groups won decisive battles with the Imperial Japanese Navy.
```{r}
leaflet() %>%
addProviderTiles("Stamen.Watercolor", group = "map") %>%
addCircleMarkers(data = sinking_data_dd_42,
lng = ~lon,
lat = ~lat,
color = ~pal(sinking_agent),
group = "1942",
popup = ~paste(name, cas_est, type, sinking_agent, date, sep = " ")) %>%
addCircleMarkers(data = sinking_data_dd_43,
lng = ~lon,
lat = ~lat,
color = ~pal(sinking_agent),
group = "1943",
popup = ~paste(name, cas_est, type, sinking_agent, date, sep = " ")) %>%
addCircleMarkers(data = sinking_data_dd_44,
lng = ~lon,
lat = ~lat,
color = ~pal(sinking_agent),
group = "1944",
popup = ~paste(name, cas_est, type, sinking_agent, date, sep = " ")) %>%
addCircleMarkers(data = sinking_data_dd_45,
lng = ~lon,
lat = ~lat,
color = ~pal(sinking_agent),
group = "1945",
popup = ~paste(name, cas_est, type, sinking_agent, date, sep = " ")) %>%
addCircleMarkers(data = sinking_data_dd_cas_est,
lng = ~lon,
lat = ~lat,
color = ~pal(sinking_agent),
group = "1942 - 1945",
popup = ~paste(name, cas_est, type, sinking_agent, date, sep = " ")) %>%
addLegend(position = "bottomright",
pal= pal,
values = c("aircraft", "mine", "submarine", "surface_craft"),
title = "Sinking Agent") %>%
addLayersControl(
baseGroups = c("1942","1943","1944","1945","1942 - 1945"))
```
This is a map of all ships sunk by U.S. Army Air Force air dropped mines, aircraft and subs from May 1945 until the end of the war. Exploring the map shows the various clusters of mining activity and the overwhelming density sinkings within the Kanmon straits. As one reduces the viewing scale, the extend of the mining campaign becomes apparent as seemingly every inlet saw a merchant ship sink. Smaller clusters of mining activity occurred on outside of the Port of Niigata, other port facilities on the western coast of the island of Honshu, and off the Korean coast.
```{r}
leaflet() %>%
addProviderTiles("Stamen.Watercolor", group = "map") %>%
addMarkers(data = downfall_aircraft,
lng = ~lon,
lat = ~lat,
group = "Aircraft",
popup = ~paste(name, cas_est, type, sinking_agent, date, sep = " "),
clusterOptions = markerClusterOptions()) %>%
addMarkers(data = downfall_mine,
lng = ~lon,
lat = ~lat,
group = "Mine",
popup = ~paste(name, cas_est, type, sinking_agent, date, sep = " "),
clusterOptions = markerClusterOptions()) %>%
addMarkers(data = downfall_sub,
lng = ~lon,
lat = ~lat,
group = "Submarine",
popup = ~paste(name, cas_est, type, sinking_agent, date, sep = " "),
clusterOptions = markerClusterOptions()) %>%
addMarkers(data = downfall,
lng = ~lon,
lat = ~lat,
group = "All Sinking Agents",
popup = ~paste(name, cas_est, type, sinking_agent, date, sep = " "),
clusterOptions = markerClusterOptions()) %>%
addLayersControl(
baseGroups = c("Aircraft","Mine","Submarine", "All Sinking Agents"))
```
Below is an interactive map of the entire campaign. A larger view is available at:
http://brandanpbuck.com/unrestricted/unrestricted.html
```{r}
sinking_data_dd_41_42 <-sinking_data_dd %>%
filter(year == 1941 |
year == 1942) %>%
filter(sinking_agent != "sabotage" |
sinking_agent != "unknown")
sinking_data_dd_jan_jun_43 <-sinking_data_dd %>%
filter(year == 1943) %>%
filter(date < "1943-07-01") %>%
filter(sinking_agent != "sabotage" |
sinking_agent != "unknown")
sinking_data_dd_jul_dec_43 <-sinking_data_dd %>%
filter(year == 1943) %>%
filter(date > "1943-06-28") %>%
filter(sinking_agent != "sabotage" |
sinking_agent != "unknown")
sinking_data_dd_jan_mar_44 <-sinking_data_dd %>%
filter(year == 1944) %>%
filter(date < "1944-04-01") %>%
filter (sinking_agent != "sabotage" |
sinking_agent != "unknown")
sinking_data_dd_apr_sep_44 <-sinking_data_dd %>%
filter(year == 1944) %>%
filter(date < "1944-10-01") %>%
filter(date > "1944-03-30") %>%
filter (sinking_agent != "sabotage" |
sinking_agent != "unknown")
sloc_closed_mar_44<- sloc %>%
filter(Closed != "March 44")
sinking_data_dd_oct_dec_44 <-sinking_data_dd %>%
filter(year == 1944) %>%
filter(date > "1944-09-29",
sinking_agent != "sabotage" |
sinking_agent != "unknown")
sloc_closed_may_44<- sloc %>%
filter(Closed != "March 44") %>%
filter(Closed != "May 44")
sinking_data_dd_jan_apr_45 <-sinking_data_dd %>%
filter(year == 1945) %>%
filter(date < "1945-04-30",
sinking_agent != "sabotage" |
sinking_agent != "unknown")
sloc_closed_dec_44<- sloc %>%
filter(Closed != "March 44") %>%
filter(Closed != "May 44") %>%
filter(Closed != "Dec 44")
sinking_data_dd_may_aug_45 <-sinking_data_dd %>%
filter(year == 1945) %>%
filter(date > "1945-04-30",
sinking_agent != "sabotage" |
sinking_agent != "unknown")
sloc_closed_may_45<- sloc %>%
filter(Closed != "March 44") %>%
filter(Closed != "May 44") %>%
filter(Closed != "Dec 44") %>%
filter(Closed != "May 45")
leaflet() %>%
addProviderTiles("Stamen.Watercolor", group = "Map") %>%
addProviderTiles("Esri.WorldImagery", group = "Imagery") %>%
addCircleMarkers(data = sinking_data_dd_41_42,
lng = ~lon,
lat = ~lat,
color = ~pal(sinking_agent),
radius = 3,
popup = ~paste(name, type, sinking_agent, date, sep = ","),
group = "1. Dec, 1941- Dec, 1942") %>%
addPolylines(data = sloc,
color = "grey",
group = "1. Dec, 1941- Dec, 1942") %>%
addCircleMarkers(data = sinking_data_dd_jan_jun_43,
lng = ~lon,
lat = ~lat,
color = ~pal(sinking_agent),
radius = 3,
popup = ~paste(name, type, sinking_agent, date, sep = ","),
group = "2. Jan-Jun 1943") %>%
addPolylines(data = sloc,
color = "grey",
group = "2. Jan-Jun 1943") %>%
addCircleMarkers(data = sinking_data_dd_jul_dec_43,
lng = ~lon,
lat = ~lat,
color = ~pal(sinking_agent),
radius = 3,
popup = ~paste(name, type, sinking_agent, date, sep = ","),
group = "3. Jul - Dec, 1943") %>%
addPolylines(data = sloc,
color = "grey",
group = "3. Jul - Dec, 1943") %>%
addCircleMarkers(data = sinking_data_dd_jan_mar_44,
lng = ~lon,
lat = ~lat,
color = ~pal(sinking_agent),
radius = 3,
popup = ~paste(name, type, sinking_agent, date, sep = ","),
group = "4. Jan-Mar, 1944") %>%
addPolylines(data = sloc,
color = "grey",
group = "4. Jan-Mar, 1944") %>%
addCircleMarkers(data = sinking_data_dd_apr_sep_44,
lng = ~lon,
lat = ~lat,
color = ~pal(sinking_agent),
radius = 3,
popup = ~paste(name, type, sinking_agent, date, sep = ","),
group = "5. Apr-Sep, 1944") %>%
addPolylines(data = sloc_closed_mar_44,
color = "grey",
group = "5. Apr-Sep, 1944") %>%
addCircleMarkers(data = sinking_data_dd_oct_dec_44,
lng = ~lon,
lat = ~lat,
color = ~pal(sinking_agent),
radius = 3,
popup = ~paste(name, type, sinking_agent, date, sep = ","),
group = "6. Oct-Dec, 1944") %>%
addPolylines(data = sloc_closed_may_44,
color = "grey",
group = "6. Oct-Dec, 1944") %>%
addCircleMarkers(data = sinking_data_dd_jan_apr_45,
lng = ~lon,
lat = ~lat,
color = ~pal(sinking_agent),
radius = 3,
popup = ~paste(name, type, sinking_agent, date, sep = " "),
group = "7. Jan-Apr, 1945") %>%
addPolylines(data = sloc_closed_dec_44,
color = "grey",
group = "7. Jan-Apr, 1945") %>%
addCircleMarkers(data = sinking_data_dd_may_aug_45,
lng = ~lon,
lat = ~lat,
color = ~pal(sinking_agent),
radius = 3,
popup = ~paste(name, type, sinking_agent, date, sep = ","),
group = "8. May-Aug, 1945") %>%
addPolylines(data = sloc_closed_may_45,
color = "grey",
group = "8. May-Aug, 1945") %>%
addLegend(position = "bottomright",
pal= pal,
values = c("aircraft", "mine", "submarine", "surface_craft"),
title = "Sinking Agent") %>%
addLayersControl(
baseGroups = c("Map", "Imagery"),
overlayGroups = c("1. Dec, 1941- Dec, 1942","2. Jan-Jun 1943","3. Jul - Dec, 1943",
"4. Jan-Mar, 1944","5. Apr-Sep, 1944",
"6. Oct-Dec, 1944", "7. Jan-Apr, 1945", "8. May-Aug, 1945")) %>%
addScaleBar(position = "bottomleft",
options = scaleBarOptions(maxWidth = 250, imperial = TRUE,
metric = FALSE, updateWhenIdle = TRUE))
```