Following on from my previous post on creating a postcode file with the 2015 general election results I wanted to create a larger file with more variables. Some from the ONS lookups, others from different public datasets. The one I have added so far is the Office of Communications Broadband Coverage dataset from 2013.
The final dataset will contain for each postcode in the UK:
- The 2015 general election result
- The Westminster Election Constituency
- The Easting and Northing coordinates
- Census lookup areas
- Rural Indicator
- Broadband coverage data
- Which (if any) national park the postcode is in
The R tools used in this code are
- Importing both .csv and tab delimited files into R
- Keeping and Renaming columns
- Removing spaces from the postcodes ready to merge the data
- Concatenating two data frames of the same format
- Removing unneeded data frames
- Merging data frames
- Outputting a data frame to .csv
I will hopefully get onto analysing this data at some point. Here is the code used to create the postcode file:
A copy of the final output can be downloaded from here.