I am trying to depict a network on the geographic map using data contained in a cultural distance matrix. E.g.:
AT BE CH CZ
AT 0 0.00276 0.148 0.109
BE 0.00276 0 0.145 0.112
CH 0.148 0.145 0 0.257
CZ 0.109 0.112 0.257 0
Starting and ending points of the network’s lines should be located in different countries (i.e. here AT, BE, CH and CZ).
Lines should be depicted between countries when a corresponding entry of the matrix is below a certain threshold (e.g., the mean of all matrix’ entries). (I suppose dplyr package can be used to filter the data, as in the example http://www.gis-blog.com/flight-connection-map-with-r/)
The map includes countries of Eurasia. I used Trimble Data Marketplace to get Shapefile and draw a geographic map in R as below:
This map is obtained with the code:
> shapefile <- readOGR("directory_with_file", "name_of_file")
> shapefile_df <- fortify(shapefile)
> map <- ggplot() + geom_path(data = shapefile_df, aes(x = long, y = lat,
group = group),color = ‘black', size = .2)
> print(map)
How can I draw network on this geographic map now using the matrix’ data?
(Networks will represent cultural proximity of countries and its evolution over time)