1

I was just wondering if anybody had a reliable way to convert UK postcodes to their respective NUTS region/code? I managed to find a .csv on eurostat's website, but their data appears to be a bit inaccurate (i.e classifying Dudley as in Scotland and using the old NUTS regions for London).

I've searched endlessly online for anything like this, but as I've only just heard of NUTS today, I'm unsure whether I'm even looking for the right thing.

Stefan Zobel
  • 3,182
  • 7
  • 28
  • 38
Ed Cunningham
  • 179
  • 1
  • 3
  • 17
  • The [ONS release of the postcode data](http://geoportal.statistics.gov.uk/datasets?q=ONS+Postcode+Directory+(ONSPD)+February+2017&sort_by=name&sort_order=asc) contains a coded NUTS region. – Phylogenesis Apr 10 '17 at 15:34
  • Thanks, I've downloaded their latest postcode list, but the NUTS region it provides is not as I expected. For example, E05009695, rather than UKF14. Am I reading this correctly? Or is their a way to convert these numbers? – Ed Cunningham Apr 10 '17 at 21:19
  • In the Documents directory in the zip file, there are some supporting documents, including at least one that can convert from the E05xxxxxx number to a region name. In fact, the file named `LAU216_LAU116_NUTS315_NUTS215_NUTS115_UK_LU.txt` contains the conversion from `E05009695` to `UKF16` as well as the region name. – Phylogenesis Apr 11 '17 at 07:36

1 Answers1

0

The title of your question says NUTS to UK postcodes but in the body you mention UK postcodes to NUTS. I'm not sure whether you are interested in both.

There is a simple way to turn UK postcode to NUTS (both names and codes) using R:

devtools::install_github("erzk/PostcodesioR")
library(PostcodesioR)

# both will work:
postcode_query("EC1Y8LX")
postcode_lookup("EC1Y8LX")

This will return a list with geographic information about the postcodes.

Disclaimer: I'm the author of the PostcodesioR package.

epo3
  • 2,991
  • 2
  • 33
  • 60
  • Thanks for your reply, your script looks very interesting, but is there a way to return as a data frame, rather than a list? My R knowledge is pretty lacking I'm afraid! – Ed Cunningham Jul 21 '17 at 14:30
  • `as.data.frame()` is the way to go – epo3 Jul 21 '17 at 16:13
  • Don't uk postcodes need to have a space between the first and second half? – Topde Jun 24 '21 at 08:18
  • Yes, the standard format includes a space. However, these functions will work without spaces as well. – epo3 Jul 24 '21 at 07:27