0

where do I find the EU NUTS code in the shapefile in R?

NUTS = Nomenclature of Territorial Units for Statistics

Each NUTS region has a NUTS code:

Example picture for Germany.

You can also find the detailed NUTS codes in this Excel file.

When I download the NUTS shapefile, I cannot find this NUTS code.

I downloaded the shapefile NUTS_2013_20M_SH.zip from:

ec.europa.eu/eurostat/web/gisco/geodata/reference-data/administrative-units-statistical-units/nuts#nuts13

After downloading, I upload the shapefile into R using the code:

library(sp)
library(rgdal)

dir <- setwd(getwd())

NUTS_shape = readOGR(dsn = (dsn = "~/NUTS_2013_20M_SH/data", layer = "NUTS_BN_20M_2013")

NOTE:

  • dsn = is the path to the folder in which you saved the shapefile.
  • layer = is the name of the file without the file extension (e.g., .shp)

If I use summary(NUTS_shape), I only find a "NUTS_BN_ID" but no NUTS code. Also if I use str(NUTS_shape[4461,]) to see the list structure of example-item 4461, it doesn't seem like there is a NUTS code.

Does anyone know if the NUTS shapefile contains the NUTS code or if the NUTS_BN_ID is somehow linked to this code?

hrbrmstr
  • 77,368
  • 11
  • 139
  • 205
Thomas V.
  • 41
  • 5
  • Would be nice to get at least a comment instead of a "-1" rating. Otherwise, I have no idea what you dislike about my question. – Thomas V. Sep 06 '16 at 15:47

1 Answers1

3

I found the answer:

In case someone is also working with NUTS data, then you will find the NUTS code not in the layer "NUTS_BN_20M_2013" but you have to use another layer, that is: "NUTS_RG_20M_2013".

Hence, use the code:

NUTS_shape = readOGR(dsn = (dsn = "~/NUTS_2013_20M_SH/data", layer = "NUTS_RG_20M_2013")

Then if you write NUTS_shape@data you get:

  NUTS_ID STAT_LEVL_  SHAPE_AREA SHAPE_LEN
0      AT          0 10.04269653 22.922441
1     AT1          1  2.84477225 10.876468
2    AT11          2  0.47903755  5.591853
3   AT111          3  0.08480488  1.178272
4   AT112          3  0.21836213  2.649698
5   AT113          3  0.17587054  2.276286

The NUTS_ID equals the code.

Thomas V.
  • 41
  • 5