Pages Menu
TwitterRss
Categories Menu

Posted by on Aug 17, 2011 in R Spatial, Resources, Visualisation | 5 comments

Improved Tree Maps with R

Improved Tree Maps with R

“Treemaps display hierarchical (tree-structured) data as a set of nested rectangles. Each branch of the tree is given a rectangle, which is then tiled with smaller rectangles representing sub-branches. A leaf node’s rectangle has an area proportional to a specified dimension on the data. Often the leaf nodes are colored to show a separate dimension of the data. When the color and size dimensions are correlated in some way with the tree structure, one can often easily see patterns that would be difficult to spot in other ways, for example, if a certain color is particularly relevant. A second advantage of treemaps is that, by construction, they make efficient use of space. As a result, they can legibly display thousands of items on the screen simultaneously.” (source: Wikipedia) I think treemaps are becoming an increasingly popular method of visualising multidimensional datasets and there are many ways to create them. This tutorial is going to focus on the use of R and builds on the one published on flowingdata. Open R...

Read More

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 Sep 7, 2010 in R Spatial, Resources | 2 comments

Writing a Spatial Function: The Location Quotient

Background: In some cases it is necessary to conduct the same analysis multiple times on either the same or different data. In such circumstances it is worth writing a function to simplify the code. In this example the location quotient provides a simple calculation easily written in to a function. The location quotient (LQ) is an index for comparing a region’s share of a particular activity with the share of that same activity found at a more aggregate spatial level (a good book on this kind of thing is Burt et al.). In this example we take a shapefile of London Boroughs that contains information on the population of each borough and the percentage of sports participation in each borough. In this case there is little point in calculating the LQ as the percentage alone would be more meaningful. The focus here is how to undertake the methods, not their appropriate use, or the validity of the results. Data Requirements: London Sport Participation Shapefile: Download (requires unzipping) Install the...

Read More

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

R Maps

R Maps

This is an updated version of my Making Maps with R tutorial. I think the code is lot simpler and it also includes some data for you to play around with. Background: Spatial data are becoming increasingly common, as are the tools available in R to process it. Of course one of the best ways of visualizing spatial data is through a map. Maps need to be well thought out. Not least, the selected colours need to be appropriate and sufficient context is provided through the use of a legend, title, scale bar and north arrow. The worksheet will demonstrate how to produce a map with R that includes all these elements. Data Requirements: London Sport Participation Shapefile. Download (requires unzipping) Install the following packages (if you haven’t already done so): maptools, RColorBrewer, classInt Click here to view the tutorial...

Read More