IMD Lava Lamp Plots
The repo contains the data and r script to make 'lava lamp plots' by administrative geography, using the Indices of Deprivation data published by the Ministry for Housing, Communities and Local Government.
Feel free to clone this repo into a new project to open in RStudio.
The file Working_Script.R has the code needed to generate the plots. I've annotated this file as best I can, without overdoing it.
To make this, I:
- Got English LSOA deprivation data from OpenDataCommunities
- Got English LA deprivation data from OpenDataCommunities
- Got an English lookup file from Office for National Statistics
- Got Welsh LSOA deprivation data from StatsWales
- Got a Welsh lookup file from StatsWales
- Separately for England and Wales Matched the data so that I had a single dataframe with lsoa, lsoa deprivation rank, la, la name, la deprivation rank
- Calculated the vingtiles of each lsoa (1 - 20)
- Plotted this as a violin plot using ggplot2 in R
Supporting data is available in the data folder.
The source of the data is:
Still to do
- Change ordering of the plots
- Do Northern ireland
- Add data for colouring (such as political control)
- Do a version by parliamentary constituency
- Make a low-res version of the image to embed in this readme
- Sort the labels so they fit (wrap or truncate gracefully)
- RStudio - IDE for R
- ggplot2 - the plots
- OpenDataCommunities - For the England deprivation data
- Office for National Statistics Geoportal - For the lookups between geo boundaries
- Jamie Whyte - northernjamie
- Hadley Wickham for the marvellous ggplot2