## Mapping Flows in R

Last year I published the above graphic, which then got converted into the below for the book London: The Information Capital. I have had many requests for the code I used to create the plot so here it is! The data shown is the Office for National Statistics flow data. See here for the latest version. The file I used for the above can be downloaded here (it is >109 mb uncompressed so you need a decent computer to load/plot it all at once in R). You will also need this file of area (MSOA) codes and their co-ordinates. The code used is pasted below with comments above each segment. Good luck! library(plyr) library(ggplot2) library(maptools) Load the flow data required – origin and destination points are needed. See above for where you can get the table used here. input<-read.table("wu03ew_v1.csv", sep=",", header=T) We only need the first 3 columns of the above input names(input) The UK Census file above didn’t have coordinates just area codes. Here is a lookup that provides...

Read More