Pages Menu
TwitterRss
Categories Menu

Posted by on Feb 16, 2011 in Featured Maps, London, R Spatial, Visualisation | 6 comments

Mapping London’s Population Change 1801-2030

Mapping London’s Population Change 1801-2030

Buried in the London Datastore are the population estimates for each of the London Boroughs between 2001 – 2030. They predict a declining population for most boroughs with the exception of a few to the east. I was surprised by this general decline and also the numbers involved- I expected larger changes from one year to the next. I think this is because my perception of migration is of the volume of people moving rather than the net effects on the baseline population of these movements. I don’t envy the GLA for making predictions so far into the future, but can understand why they have to do it (think how long it took initiate Crossrail!). Last year I produced a simple animation showing past changes in London’s population density (data) and it provides a nice comparison to the above. In total I have squeezed 40 maps on this page! Technical Stuff These maps were all produced to demonstrate the mapping capabilities of R. The first uses ggplot2 (plus classInt + RColorBrewer) and is based on some code...

Read More

Posted by on Jan 10, 2011 in Resources, Visualisation | 5 comments

R interface to Google Chart Tools

R interface to Google Chart Tools

Hans Rosling eat your heart out! It is now possible to interface R statistics software to Google’s Gapminder inspired Chart Tools. The plots below were produced using the googleVis R package and three datasets from the Gapminder website. The first shows the relationship between income, life expectancy and population for 20 countries with the highest life expectancy in 1979 and the bottom plot shows the countries with the lowest 1979 life expectancy. Press play to see how the countries have faired over the past 50 years. You can also change the variables represented on each axes, the colours and the variable that controls the size of the bubbles. Data: all_date, Chart ID: MotionChart_2011-01-10-10-16-25 R version 2.12.1 (2010-12-16), Google Terms of Use Data: all_date, Chart ID: MotionChart_2011-01-10-10-10-46 R version 2.12.1 (2010-12-16), Google Terms of Use It was a bit fiddly to get the data formatted correctly and I couldn’t manage to get the complete dataset in one plot because my browser kept crashing (Chrome is best). Even with these teething...

Read More

Posted by on Jan 3, 2011 in R Spatial | 9 comments

Exporting KML from R

Exporting KML from R

Google Earth has become a popular way of disseminating spatial data. KML is the data format required to do this. It is possible to load almost any type of spatial data format into R and export it as a KML file. In my experience R seems much quicker at doing this than many well-known GIS platforms, such as ArcGIS. The worksheet below explains how. Data and Package Requirements: London Cycle Hire Locations. Download. Install the following packages (if you haven’t already done so): maptools, rgdal (Mac users may wish to see here first). Click here to view the tutorial...

Read More

Posted by on Sep 27, 2010 in R Spatial | 7 comments

Maps with ggplot2

Maps with ggplot2

The ggplot2 package offers powerful tools to plot data in R. The plots are designed to comply with the “grammar of graphics” philosophy and can be produced to a publishable level relatively easily. For users wishing to create a good map without too much thought I would recommend this worksheet. For those without their own shapefiles who rely on the “maps” package they may wish to consult Hadley Wickham‘s ggplot2 book. Data Requirements: London Sport Participation Shapefile. Download (requires unzipping) poly_coords function. Download Install the following packages (if you haven’t already done so): maptools, RColorBrewer, ggplot2 Click here to view the tutorial code....

Read More

Posted by on Sep 8, 2010 in R Spatial, Resources | 6 comments

Clipping a Surface By a Polygon

Clipping a Surface By a Polygon

Background: A common function in standard GIS software enables users to create a raster surface and extract values or clip it based on a set of polygons. This may be used in cases where you want analysis to be constrained to within a town’s boundaries or a coastline. This tutorial will outline how to create a surface using kernel density estimation (KDE) and then clip the surface so that it is constrained within the City of London Boundary. Data Requirements: City of London Boundary Shapefile: Download (requires unzipping). London Cycle Hire Locations: Download. Install the following packages (if you haven’t done so already): sm, maptools.? Click here to view the...

Read More