Skip to content

Instantly share code, notes, and snippets.

@briatte
Last active April 13, 2016 18:29
Show Gist options
  • Save briatte/c6df2f855afb4eb142e6 to your computer and use it in GitHub Desktop.
Save briatte/c6df2f855afb4eb142e6 to your computer and use it in GitHub Desktop.

MENA Alliances Network

Sources:

See also The Big Pharaoh's Complete Idiot's Chart to Understanding the Middle East.

The file below (in Pajek format) adds links from and to the Lebanese Hezbollah, as well as tentative longitude/latitude coordinates, based on capitals. Shortlink to the file: https://goo.gl/oNdgdB.

Example graph using ggnet2, with nodes colored by Spinglass-detected community:

Example graph using ggnetworkmap (unreleased), with nodes and edges colored by NATO membership (USA and Turkey in blue, rest in red):

*Vertices 20
1 "bahrain_etc" 50.5577 26.0667
2 "egypt_gov" 31.23571 30.04442
3 "egypt_mb" 31.23571 30.04442
4 "iran" 51.38897 35.6892
5 "iraq_gov" 44.36149 33.31281
6 "iraq_kurd" 44.00887 36.20629
7 "jordan" 35.9457 31.95658
8 "libya_dawn" 13.19134 32.88721
9 "libya_dignity" 21.73762 32.75642
10 "qatar" 51.53044 25.29161
11 "russia" 37.6173 55.75583
12 "saudi" 46.90284 24.7494
13 "syria_gov" 36.28478 33.4935
14 "syria_misc" 36.28478 33.4935
15 "turkey" 32.85974 39.93336
16 "uae" 54.69728 24.29917
17 "usa" -77.03687 38.90719
18 "yemen_gov" 45.01865 12.7855
19 "yemen_houthi" 44.19101 15.36945
20 "lebanon_hizb" 35.49548 33.88863
*Arcs
1 18
2 9
2 18
4 5
4 6
4 13
4 19
4 20
7 2
7 14
7 18
10 3
10 8
10 14
10 18
11 13
12 2
12 9
12 18
13 20
15 3
15 8
15 14
16 2
16 9
16 18
17 5
17 6
17 14
17 18
20 13
library(igraph)
library(wesanderson)
mena = read.graph("https://goo.gl/oNdgdB", format = "pajek") # MENA_Alliances_Network.net
V(mena)$comm = spinglass.community(mena)$membership
V(mena)$comm = wes_palette("Darjeeling")[ V(mena)$comm ]
source("https://raw.githubusercontent.com/briatte/ggnet/master/ggnet2.R")
ggnet2(mena, size = 12, color = "white", label = "id", label.color = "comm", layout.exp = 0.25)
library(ggplot2)
library(network)
library(maptools)
library(raster)
# load network data
mena = read.paj("https://goo.gl/oNdgdB", format = "pajek") # MENA_Alliances_Network.net
# load and crop map
data("wrld_simpl")
world = crop(wrld_simpl, extent(-80, 60, 10, 60))
# convert map to ggplot2
world = fortify(world)
world = ggplot(world, aes(x = long, y = lat)) +
geom_polygon(aes(group = group), color = "black",
fill = "grey95", size = 0.2)
# map + network plot
mena %v% "lon" = mena %v% "x"
mena %v% "lat" = mena %v% "y"
# unreleased function
ggnetworkmap(world, mena, node.color = nato_nodes, segment.color = nato_edges)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment