Prerequisites

require(rsdmx)
## Loading required package: rsdmx
## Warning: package 'rsdmx' was built under R version 3.1.2
require(plyr)
## Loading required package: plyr

Data processing

Read data from EUROSTAT at NUTS 2

You may browse statistics by theme and then build the url with the table id and the required criteria, like start period and end period. See Data Navigation Tree.

Table ID Information
tgs00003 GDP by NUTS 2 regions (M EUR)
tgs00037 Real growth rate at market prices (%)
tgs00026 Disposable income of private households (PPS per inhabitant)
tgs00096 population
tgs00024 population density
Field Interpretation
VAR Variable code
UNIT Measurement unit
INDIC_NA National accounts indicator
GEO NUTS 2 code
FREQ A (Annual)
obsTime Value
OBS_FLAG :=na s=Eurostat estimate b=break in time series p=provisional e=estimated
# Catalogue of selected variable ids
tablesid <- c("tgs00003", "tgs00037", "tgs00026", "tgs00096", "tgs00024")

# Generate empty data frame
df <- data.frame(VAR = character(0))

# Iterate for each variable in the catalogue
for (i in 1:length(tablesid)){
  url <- paste("http://ec.europa.eu/eurostat/SDMX/diss-web/rest/data/",
               tablesid[i],
               sep = "")
  sdmx <- cbind(VAR = tablesid[i], as.data.frame(readSDMX(url)))
  df <- rbind.fill(df, sdmx) # from package plyr, to control for new columns
}