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 to 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 (see below) written by Mark Bulling. If you follow the code below you will end up with this map, not the one I have produced above. I will stick my code in a formal tutorial soon. The animation uses the standard plot functions (plus spatial packages) in R as per this example.

10 Comments

  1. Christy

    Hi,

    Thanks for posting this. I’m working through MB’s code and encountered an error at line 30.

    > london.data.cast <- cast(london.data.melt, variable~., fun.aggregate=sum)
    Error: Casting formula contains variables not found in molten data: variable

    Do you know what is needed to successfully cast the data? Any help will be greatly appreciated.

    Best regards,
    Christy

  2. Christy

    Hi,

    I was able to work through the code provided, to produce the map you linked to, by fixing two lines of code.

    The line that reads:

    london.data.melt <- melt(x, id=c("Code", "Area",
    "Total.Number.of.Registrations", "MYE.Working.age.2008"))

    works if changed to:

    london.data.melt <- melt(london.data, id=c("Code", "Area",
    "Total.Number.of.Registrations"))

    and the line that reads:

    scale_fill_brewer(palette = "PuRd", label_value = "Number of
    registered immigrants")+

    works if changed to:

    scale_fill_brewer(palette = "PuRd")+

    Thanks again for posting!!

  3. Christy

    Hi,

    I was able to work through the code provided, to produce the map you linked to, by fixing two lines of code.

    The line that reads:

    > london.data.melt london.data.melt scale_fill_brewer(palette = “PuRd”, label_value = “Number of registered immigrants”)+

    works if changed to:

    > scale_fill_brewer(palette = “PuRd”)+

    Thanks again for posting!!

  4. Osmar

    Hi,

    I’d to know if you’ve already posted the tutorial. I’ve just turned to R’s geovisualization capabilities recently, so I’d appreciate a lot to see your tutorial as it would help me a lot to master R mapping capabilities, which currently I use mainly in cross-sectional analysis of geodata.

Comments are closed.