townsendr interactive map

         · · ·      · · · · ·

This week I updated my Townsend Material Deprivation Score project. The update makes townsendr an interactive online map of deprivation that users can simply view in their browser, rather than having to download and run the R code or view only static maps. I think the result is much more intuitive and useful. Making the map interactive is achieved by using Shiny, a technology for R to make interactive charts and plots. As well as this, the maps are now rendered by leaflet rather than ggplot2. ggplot2 is an awesome technology for making beautiful charts in R, but leaflet is a javascript library designed specifically for plotting interactive maps so rendering the map is now so effortless it felt like cheating.

The data is based on the relevant census tables obtained from Nomis. The shapefiles are obtained from the UK Data Service, but are greatly simplified (even the generalised versions were about 5MB, much too big for interactive use). Both are available under open licenses. For more information see the townsendr web page or the GitHub repository. Pull requests are very welcome.

I’m really happy with the result, which is my first attempt using Shiny and leaflet, but there’s more work to do (when I have time!). Specifically I think the following need addressing:

If you notice anything else, fix it and submit a pull request or file an issue for me to address!