nathanlane / imd-lava-lamps

#rstats dataviz showing indices of deprivation in 'lava lamps'

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

Lava Lamp Plots

Getting Started

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)

Built With

Author

Acknowledgments

About

#rstats dataviz showing indices of deprivation in 'lava lamps'

License:GNU General Public License v2.0


Languages

Language:G-code 99.5%Language:R 0.3%Language:HTML 0.2%