Over the past few years a good source of data has been Parliament’s petitions website. Anyone can start petitions or sign them. MPs have to consider the ones that get to 100,000 signatures for debates. The most popular petitions often end up leading the news cycle, such as the petition arguing for a second EU … Read More “Scraping in R: Access to mortgage petition” »
Category: See
It’s time to branch out into a new area of data visualisation: proportion area plots. These plots use area to show proportion between different related values. A common type of proportional area plots are tree maps. We are going to be using the same principle but with circles. A common subject for area visualisation is … Read More “Spring Budget 2017: Circle visualisation” »
R has a lot of packages for users to analyse posts on social media. As an experiment in this field, I decided to start with the biggest one: Facebook. I decided to look at the Facebook activity of Donald Trump and Hillary Clinton during the 2016 presidential election in the United States. The winner may … Read More “Comparing Donald Trump and Hillary Clinton’s Facebook pages during the US presidential election, 2016” »
Earlier this month Marie Segger, Carlos Novoa and I had a major new project published about different rail speeds between cities around Britain. We compared the distances between train stations in Britain’s largest cities and found which areas were poorly-served by slow trains. Our project was picked up by a MP for Plymouth, a city … Read More “Calculating Distances in R: How Fast is Your Train?” »
Introduction In Part I we looked at overall internal migration local authority by local authority – are more people coming than going? In Part II we looked at where people are moving from and to around the country. Here in the final Part III we will look at the ages of people moving in and out. … Read More “Internal Migration Part III: Plotting Age Groups” »
In the first post we completed a hexagonal map showing internal migration at a glance around England and Wales in 2015/16. This map is very good for an overview of what’s going on around the country – is your area getting more people from or losing people to other parts of Britain? But it doesn’t … Read More “Internal Migration, Part II: Homing in on individual authorities” »
The Office for National Statistics published some of its most interesting data last week – internal migration. This is the movement of people within the UK of people who are already here, not counting people immigrating or emigrating from abroad. The ONS publishes its headline estimates and also the full underlying data, containing each possible … Read More “Internal Migration, Part I: Hexagonal maps of movement of people” »
At work I’ve been working on a project called Find My Seat, which is now live. You type in your postcode and it presents you with lots of useful data about the economy, healthcare, immigration and Brexit in your area. I pulled all the data used in the widget together. One task I had … Read More “Practice with For Loops: Calculating Mean Ages” »
Like other departments the Ministry of Justice publishes spending data worth more than £25,000. It does this both for itself and for its executive agencies like the National Offender Management Service (NOMS) which runs the prison system. It does this monthly. A typical spreadsheet looks like this in R: dec <- read.csv(“noms-spend-december-2016.csv”) str(dec) ‘data.frame’: 14006 obs. … Read More “Using R to make Freedom of Information requests” »
Last week I wrote some stories about cyclists involved in accidents while undertaking. The stories generated a LOT of comment and debate – both far more and far more negative than I was expecting. I’ll address that in a moment, but first, here’s a useful exercise in how to get the Government’s STATS19 data and filter down to … Read More “Cyclists Involved in Accidents Undertaking” »