We’d like to show on the map the statistics of space launches in 2017.
Source data is taken from the Wikipedia.
First, we load the statistics of launches:
Site Country Launches Success Failure Partial
1 Baikonur Russia 13 12 0 1
2 Cape Canaveral United States 7 7 0 0
3 Jiuquan China 6 6 0 0
4 Kennedy United States 12 12 0 0
5 Kourou France 11 11 0 0
6 Mahia New Zealand 1 0 1 0
7 MARS United States 1 1 0 0
8 Plesetsk Russia 5 5 0 0
9 Satish Dhawan India 5 4 1 0
10 Semnan Iran 1 0 1 0
11 Taiyuan China 2 2 0 0
12 Tanegashima Japan 6 6 0 0
13 Uchinoura Japan 1 0 1 0
14 Vandenberg United States 9 9 0 0
15 Vostochny Russia 1 0 1 0
16 Wenchang China 2 1 1 0
17 Xichang China 8 7 0 1
and site coordinates (collected from Wikipedia as well):
Site Latitude Longitude
1 Baikonur 45.965000 63.30500
2 Cape Canaveral 28.488889 -80.57778
3 Jiuquan 40.960556 100.29833
4 Kennedy 28.524058 -80.65085
5 Kourou 5.237222 -52.76056
6 Mahia -39.260900 177.86550
7 MARS 37.843333 -75.47806
8 Plesetsk 62.925556 40.57778
9 Satish Dhawan 13.719939 80.23042
10 Semnan 35.234440 53.92080
11 Taiyuan 38.849100 111.60800
12 Tanegashima 30.400000 130.97000
13 Uchinoura 31.251944 131.08194
14 Vandenberg 34.732778 -120.56806
15 Vostochny 51.884395 128.33393
16 Wenchang 19.614354 110.95106
17 Xichang 28.246017 102.02656
We can join these two datasets on Site to obtain a dataframe which we can feed to leaflet:
df <- merge(launches, sites, on = 'Site')
And construct the map of space launches using pie chart for each site:
library(leaflet)
library(leaflet.minicharts)
map <- leaflet() %>%
addTiles() %>%
addMinicharts(
df$Longitude,
df$Latitude,
chartdata = df[, c('Success', 'Failure', 'Partial')],
color = c('Blue', 'Red', 'Yellow'),
type = 'pie', width = 10 * sqrt(df$Launches),
layerId = df$Site
)
Generated on: 09 May, 2018