NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

eurostat: Tools for Eurostat Open Data

Leo Lahti, Janne Huovari, Markus Kainu, Przemysław Biecek, Przemyslaw BiecekOpenalex Unknown 2015 · OpenAlex

Introduction

The eurostat R package serves as a comprehensive programmatic interface for the Eurostat database, the European Union's primary source for statistical information. As Eurostat transitioned its infrastructure in late 2023 from a legacy bulk download facility to new SDMX 2.1 and JSON-based Dissemination APIs, researchers faced significant challenges in maintaining reproducible workflows. The eurostat package automates the entire pipeline—from data discovery and server-side filtering to downloading, caching, and converting complex datasets into analysis-ready tidy data frames.

Addressing API Complexity and Data Volume

Accessing Eurostat data manually is inefficient and often impractical due to the sheer volume of information; some datasets exceed 140 million observations. The package addresses several critical hurdles for researchers:

  1. API Abstraction: Navigating between SDMX and JSON endpoints based on query requirements without manual intervention.
  2. Standardization: Converting Eurostat-specific codes (e.g., NUTS regions or custom time formats like "2015-Q1") into standard R formats.
  3. Geospatial Integration: Linking statistical data with administrative boundary maps for visualization via the GISCO database.
Package metadata for eurostat version 4.0.0, highlighting the 2014-2023 development timeline.

Technical Implementation

Version 4.0.0 of the package acts as a robust wrapper for Eurostat’s updated API infrastructure. Key technical features include:

  • Dual API Support: It utilizes the SDMX 2.1 API for bulk TSV downloads and the JSON API for fine-grained, server-side filtering.
  • Automated Caching: A local caching system for .rds files reduces server strain and improves performance for repeated queries.
  • Data Transformation: Specialized functions like eurotime2date() and eurotime2num() parse varied time formats (annual, semi-annual, quarterly, monthly, and weekly) into standard R Date objects.
  • Labeling and Harmonization: The label_eurostat() function replaces technical codes with human-readable labels in English, French, or German, while internal utilities resolve common discrepancies such as the "EL" vs "GR" country code for Greece.

Key Insights and Performance

A primary strength of the package is its "Tidy Data by Default" approach. While raw Eurostat TSV files are often provided in "wide" formats, the package defaults to "long" formats compatible with modern R analysis tools like ggplot2 and dplyr.

By leveraging the JSON API, the package enables smart filtering, allowing users to request specific sub-indicators. This is essential for handling massive datasets without exceeding local memory limits. Performance testing indicates that a machine with 16GB of RAM can process objects with up to 91 million rows. The unified get_eurostat interface automatically selects the optimal API (SDMX or JSON) based on the user's defined filters, ensuring a seamless experience despite the complex backend.

Limitations and Future Directions

Despite its robustness, the package faces certain constraints. Server-side filtering in the JSON API is currently limited to 50 sub-indicators per query. Additionally, while the package supports data.table for efficiency, the largest datasets (148M+ values) still challenge standard consumer hardware. Future work aims to provide full filtering support via the SDMX Dissemination API and expand time conversion capabilities to include daily data. As the Eurostat Dissemination API is relatively new, the package will continue to evolve alongside upstream changes in file formats and endpoints.

Summary updated

BibTeX
@inproceedings{lahti2015eurostat,
  author = {Leo Lahti and Janne Huovari and Markus Kainu and Przemysław Biecek and Przemyslaw Biecek},
  title = {{eurostat: Tools for Eurostat Open Data}},
  booktitle = {Openalex Unknown},
  year = {2015},
  doi = {10.32614/cran.package.eurostat},
}
Figure