Pages Menu
TwitterRss
Categories Menu

Posted by on Mar 30, 2015 in R Spatial, Resources, Spatial Analysis, Visualisation | 9 comments

Mapping Flows in R

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

Posted by on Nov 6, 2014 in London, R Spatial, Visualisation | 6 comments

Improving R Data Visualisations Through Design

Improving R Data Visualisations Through Design

When I start an R class, one of my opening lines is nearly always that the software is now used by the likes of the New York Times graphics department or Facebook to manipulate their data and produce great visualisations. After saying this, however, I have always struggled to give tangible examples of how an R output blossoms into a stunning and informative graphic. That is until now… I spent the past year working hard with an amazing designer – Oliver Uberti – to create a book of 100+ maps and graphics about London. The majority of graphics we produced for London: The Information Capital required R code in some shape or form. This was used to do anything from simplifying millions of GPS tracks, to creating bubble charts or simply drawing a load of straight lines. We had to produce a graphic every three days to hit the publication deadline so without the efficiencies of copying and pasting old R code, or the flexibility to do almost any kind of plot, the book would not...

Read More

Posted by on Feb 7, 2014 in Featured Maps, R Spatial, Slideshow, Visualisation | 4 comments

Stunning Maps of World Topography

Stunning Maps of World Topography

Robin Edwards, a researcher at UCL CASA, has created these stunning topographic maps using the high resolution elevation data provided by the British Oceanographic Data Centre. The transitions from black (high areas) to blue (low areas) give the maps a slightly ethereal appearance to dramatic effect. All but the highest areas of Europe appear to blend into the sea, and there is a loss in the sense of scale that makes the Pacific ranges look like small water channels in a shallow sea. The best thing about these graphics (and the main reason I have featured them here) is that they were completely produced using the R software program with just a 3 lines of code! Click here to see how Robin did it.  ...

Read More

Posted by on Jan 20, 2014 in Visualisation | 2 comments

Coxcomb Plots and Spiecharts in R

Coxcomb Plots and Spiecharts in R

I am not a great fan of pie charts since they are often used for the sake of it in circumstances where a chart is not needed at all! That said, I am willing to make an exception for “Coxcomb Plots” as pioneered by Florence Nightingale since they increase the data density on the plot and can enable comparisons across variables.  Robin Lovelace has written a neat tutorial on how to create them in R, I think it’s well worth a look. He and I also recently posted this ggplot2 and spatial data tutorial, and we have more on the way! [iframe src=”http://rpubs.com/RobinLovelace/11641″ width=”100%”...

Read More

Posted by on Dec 9, 2013 in R Spatial, Resources, Spatial Analysis | 12 comments

Introduction to Spatial Data and ggplot2

Introduction to Spatial Data and ggplot2

For those starting out with spatial data in R, Robin Lovelace and I have prepared this tutorial (funded as part of the University of Leeds and UCL Talisman project). Here we introduce a range of analysis skills before demonstrating how you can deploy the powerful graphics capabilities of ggplot2 to visualise your results. There is also some “bonus” material at the end to show how you can use ggplot2 for descriptive statistics and so on. The tutorial covers: -Introduction to ggplot2 -Map projections -Adding Google and Stamen basemaps -Clipping and joining spatial data -Aggregating spatial data -ggplot2 for descriptive statistics Download the data you need from here. This is a work in progress so we may add improvements as time goes on. We also have a few more tutorials in the pipeline that will be posted here in due course.   [iframe src=”http://rpubs.com/RobinLovelace/intro-spatial” width=”100%”...

Read More