Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
e734c91
First attempt at more SDMX based data retrieval
pitkant Jan 18, 2024
5bf1f42
Fix issues with tsv headers, col classes, missing codelists
pitkant Jan 19, 2024
92f8007
Simplify labeling by using agency instead of api_base_uri in params
pitkant Jan 19, 2024
a0f5eb2
Unify get_eurostat_sdmx with get_eurostat, address legacy output conc…
pitkant Jan 19, 2024
78fb236
metadata handling (#296)
ake123 Feb 19, 2024
beb5efe
New functionalities, local file reading etc
pitkant Apr 29, 2024
24da9db
Update country datasets (fix issue #298)
pitkant Apr 29, 2024
c81f14b
Fix a bug with get_eurostat_interactive (#307)
Allaht2 Sep 10, 2024
e0473e0
Fix merge conflict
pitkant Dec 5, 2024
e399f8f
Merge pull request #308 from rOpenGov/v4.1-dev
pitkant Dec 5, 2024
dd76b75
Fix for compression issue and missing DOI
pitkant Dec 5, 2024
ce4aa90
Add support to Asynchronous API
ake123 May 22, 2025
d60b018
update links to eurostat user-guide
wiibaa Jun 11, 2025
d7e35d0
Merge pull request #322 from wiibaa/change-link-EUROSTATHELP-to-euros…
pitkant Jun 11, 2025
efbe22f
Merge pull request #320 from ake123/v4.1-dev
pitkant Jun 25, 2025
c7febc3
issues #316 and #317
ake123 Jul 7, 2025
ea5d4c9
correction
ake123 Jul 8, 2025
dfb9be4
adding verbose
ake123 Jul 10, 2025
1d95026
Merge pull request #324 from ake123/v4.1-dev
pitkant Sep 8, 2025
6f045ef
Merge branch 'v4.1' into v4.1-dev
pitkant Sep 8, 2025
76f3584
Merge pull request #328 from rOpenGov/v4.1-dev
pitkant Sep 8, 2025
b43920b
Fix issue #326
pitkant Sep 8, 2025
3ee0262
Fix issue #327
pitkant Sep 8, 2025
31ef398
Declare imports, add httr and purrr temporarily to NAMESPACE
pitkant Sep 8, 2025
5ee1795
Update NEWS
pitkant Sep 8, 2025
ad70800
Update docs and DESCRIPTION
pitkant Sep 8, 2025
b48e305
Use verbose in get_eurostat_geospatial tests
pitkant Sep 8, 2025
c175aa7
Declare imports, use dplyr and data.table syntax in package properly
pitkant Sep 8, 2025
2e78c54
Recreate data files with UTF-8 encoding
pitkant Sep 8, 2025
90bb9b4
Use verbose=FALSE in test, add data from 2024
pitkant Sep 8, 2025
b0725ee
Remove test for case that is no longer used
pitkant Sep 8, 2025
b1b6a38
Update documentation
pitkant Sep 8, 2025
734f071
Use detail=dataonly to not confuse csv readers with flag column
pitkant Sep 8, 2025
3280119
Use actions/checkout@v5
pitkant Sep 8, 2025
772f35b
Acknowledgement
pitkant Sep 8, 2025
edb7369
Use checkout@v5
pitkant Sep 8, 2025
6d58eb9
Merge branch 'master' into v4.1
pitkant Sep 8, 2025
1b6d664
Version bump
pitkant Sep 16, 2025
664f18f
Re-render README
pitkant Sep 16, 2025
9d357d5
Update year
pitkant Sep 16, 2025
40c2865
Use na.rm in data.table::melt
pitkant Sep 16, 2025
6179335
Update CITATION to new template
pitkant Sep 16, 2025
c69ea0c
Declare functions as experimental
pitkant Sep 16, 2025
c959c34
Declare imports
pitkant Sep 16, 2025
50806a5
Tests for get_eurostat_sdmx
pitkant Sep 16, 2025
3b1d25f
Move lifecycle from imports to suggests as recommended by lifecycle d…
pitkant Sep 16, 2025
04ec552
Update docs
pitkant Sep 16, 2025
ee20cb7
Remove httr from imports
pitkant Sep 16, 2025
2e6ca61
SDMX metadata functions, version bump
pitkant Oct 16, 2025
363da2c
Remove RefManageR dependency, minor version bump
pitkant Nov 4, 2025
caf15c8
Dev version 4.1.0.9006: Remove experimental functions, fix tests
pitkant Nov 6, 2025
de31c65
Add 2024 as a valid NUTS release year
danlooo Feb 2, 2026
13576b3
Add 2024 as a valid NUTS release year to Rd
danlooo Feb 2, 2026
91dcb83
Harmonise params with giscoR
danlooo Feb 18, 2026
73061de
Keep default nuts_level
danlooo Feb 20, 2026
abf9ebb
Fix class of args
danlooo Feb 20, 2026
6c7c7a3
Add geodata for 2024
danlooo Feb 20, 2026
8db796b
Add docs for eurostat_geodata_60_2024
danlooo Feb 20, 2026
cf7edca
Update missing dataset code
danlooo Feb 20, 2026
4388e62
Merge branch 'v4.1' into master
pitkant Feb 25, 2026
dbf2533
Merge pull request #331 from danlooo/master
pitkant Feb 25, 2026
252ead5
Merge remote-tracking branch 'upstream/v4.1' into update_test_code_av…
danlooo Feb 25, 2026
f0cccef
Update missing dataset code
danlooo Feb 20, 2026
a583533
Add new contributor
danlooo Feb 25, 2026
2361552
Merge pull request #332 from danlooo/update_test_code_avia_gonc
pitkant Feb 25, 2026
c24c3a6
Replace dataset ds-059327 with another COMEXT dataset
pitkant Apr 29, 2026
1bdfea4
Replace dataset label with the label currently used in the database
pitkant Apr 29, 2026
e0df5e0
Add test skips if giscoR is not installed
pitkant Apr 29, 2026
c308fe9
Update default geospatial dataset from 2016 to 2024, version bump, ma…
pitkant May 4, 2026
a8a99da
Replace default dataset with 2024 (from 2016)
pitkant May 4, 2026
a940f0e
Update tests, snapshot to fix test problems
pitkant May 4, 2026
8856b2d
Update workflows with most recent versions
pitkant May 4, 2026
6873693
Stricter data.table version requirement
pitkant May 4, 2026
8d5f129
Add new import - R.utils - to enforce it being installed for data.table
pitkant May 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .github/workflows/check-full.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
- cron: '0 0 * * 0'

name: R-CMD-check (full)

permissions: read-all

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}
Expand All @@ -27,15 +30,14 @@ jobs:
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
Expand All @@ -44,4 +46,5 @@ jobs:

- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
upload-snapshots: true
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
11 changes: 7 additions & 4 deletions .github/workflows/check-standard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,25 @@ on:

name: R-CMD-check (standard)

permissions: read-all

jobs:
R-CMD-check:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v2
- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
23 changes: 14 additions & 9 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
Type: Package
Package: eurostat
Title: Tools for Eurostat Open Data
Version: 4.0.0
Date: 2023-12-19
Version: 4.1.0.9007
Date: 2026-04-29
Authors@R: c(
person("Leo", "Lahti", , "leo.lahti@iki.fi", role = c("aut", "cre"),
comment = c(ORCID = "0000-0001-5537-637X")),
person("Janne", "Huovari", role = "aut"),
person("Markus", "Kainu", role = "aut"),
person("Przemyslaw", "Biecek", role = "aut"),
person("Daniel", "Antal", role = "ctb"),
person("Daniel", "Loos", role = "ctb",
comment = c(ORCID = "0000-0002-4024-4443")),
person("Diego", "Hernangomez", role = "ctb",
comment = c(ORCID = "0000-0001-8457-4658")),
person("Joona", "Lehtomaki", role = "ctb"),
Expand All @@ -18,8 +20,9 @@ Authors@R: c(
person("Paul", "Rougieux", role = "ctb"),
person("Anna", "Vasylytsya", role = "ctb"),
person("Oliver", "Reiter", role = "ctb"),
person("Pyry", "Kantanen", role = "ctb",
person("Pyry", "Kantanen", role = "aut",
comment = c(ORCID = "0000-0003-2853-2765")),
person("Akewak", "Jeba", role = "ctb"),
person("Enrico", "Spinielli", , "enrico.spinielli@gmail.com", role = "ctb",
comment = c(ORCID = "0000-0001-8584-9131"))
)
Expand All @@ -38,27 +41,29 @@ Imports:
curl,
digest,
dplyr,
httr2 (>= 0.2.3),
httr2 (>= 1.1.2),
purrr,
ISOweek,
jsonlite,
lubridate,
R.utils,
rappdirs,
readr,
RefManageR,
regions,
rlang,
stringi,
stringr,
tibble,
tidyr (>= 1.0.0),
xml2,
data.table (>= 1.14.8)
data.table (>= 1.18.2.1)
Suggests:
giscoR,
giscoR (>= 1.1.0),
knitr,
rmarkdown,
sf,
testthat (>= 3.0.0)
testthat (>= 3.0.0),
lifecycle
VignetteBuilder:
knitr
Config/Needs/website: ggplot2, tmap, styler, sessioninfo,
Expand All @@ -71,6 +76,6 @@ MailingList: rOpenGov <ropengov-forum@googlegroups.com>
NeedsCompilation: no
Repository: CRAN
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
RoxygenNote: 7.3.3
X-schema.org-isPartOf: http://ropengov.org/
X-schema.org-keywords: ropengov
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
YEAR: 2014-2022
YEAR: 2014-2024
COPYRIGHT HOLDER: Leo Lahti, Janne Huovari, Markus Kainu, Przemyslaw Biecek
21 changes: 19 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ export(get_eurostat_folder)
export(get_eurostat_geospatial)
export(get_eurostat_interactive)
export(get_eurostat_json)
export(get_eurostat_link)
export(get_eurostat_local)
export(get_eurostat_sdmx)
export(get_eurostat_toc)
export(grepEurostatTOC)
export(harmonize_country_code)
Expand All @@ -30,8 +33,7 @@ export(set_eurostat_cache_dir)
export(validate_geo_code)
export(validate_nuts_regions)
importFrom(ISOweek,ISOweek2date)
importFrom(RefManageR,BibEntry)
importFrom(RefManageR,toBiblatex)
importFrom(R.utils,isUrl)
importFrom(classInt,classIntervals)
importFrom(countrycode,countrycode)
importFrom(curl,curl_download)
Expand All @@ -40,6 +42,7 @@ importFrom(data.table,.SD)
importFrom(data.table,fread)
importFrom(data.table,melt)
importFrom(data.table,setDT)
importFrom(data.table,setcolorder)
importFrom(digest,digest)
importFrom(dplyr,"%>%")
importFrom(dplyr,case_when)
Expand All @@ -52,9 +55,13 @@ importFrom(httr2,req_error)
importFrom(httr2,req_perform)
importFrom(httr2,req_proxy)
importFrom(httr2,req_retry)
importFrom(httr2,req_url_path_append)
importFrom(httr2,req_url_query)
importFrom(httr2,req_user_agent)
importFrom(httr2,request)
importFrom(httr2,resp_body_json)
importFrom(httr2,resp_body_raw)
importFrom(httr2,resp_check_status)
importFrom(httr2,resp_content_type)
importFrom(httr2,resp_is_error)
importFrom(httr2,url_build)
Expand All @@ -66,15 +73,19 @@ importFrom(lubridate,dmy)
importFrom(lubridate,month)
importFrom(lubridate,year)
importFrom(lubridate,ymd)
importFrom(purrr,map_dfr)
importFrom(readr,col_character)
importFrom(readr,cols)
importFrom(readr,read_csv)
importFrom(readr,read_tsv)
importFrom(regions,recode_nuts)
importFrom(regions,validate_geo_code)
importFrom(regions,validate_nuts_regions)
importFrom(rlang,"!!")
importFrom(rlang,.data)
importFrom(rlang,sym)
importFrom(stats,na.omit)
importFrom(stats,setNames)
importFrom(stringi,stri_extract_first_regex)
importFrom(stringi,stri_replace_all_fixed)
importFrom(stringi,stri_replace_all_regex)
Expand All @@ -89,8 +100,14 @@ importFrom(utils,capture.output)
importFrom(utils,download.file)
importFrom(utils,hasName)
importFrom(utils,menu)
importFrom(utils,modifyList)
importFrom(utils,person)
importFrom(utils,read.csv)
importFrom(utils,read.delim)
importFrom(utils,toBibtex)
importFrom(xml2,read_xml)
importFrom(xml2,xml_attr)
importFrom(xml2,xml_find_all)
importFrom(xml2,xml_find_first)
importFrom(xml2,xml_ns)
importFrom(xml2,xml_text)
34 changes: 32 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
# eurostat 4.1.0.9006

## Minor updates

* Removed experimental functions from the codebase, fixed tests that were pointing at datasets renamed by Eurostat

# eurostat 4.1.0.9005

## Deprecated and defunct

* Removed RefManageR dependency from the package due to it being unmaintained

# eurostat 4.1.0.9004

## Major updates

* Add new function `get_eurostat_sdmx()` for implementing functionalities that are specifically targeted for the new SDMX API. It is accompanied by other helper functions that are related to fetching metadata from the SDMX API: `build_api_base_uri()`, `build_agencyID()`, `data_filtering_on_dimension()`, `get_codelist_id()` and `label_eurostat_sdmx()`
* Add new function `get_eurostat_local()` for reading local SDMX-CSV (.csv) and compressed SDMX-CSV (.csv.gz) files downloaded manually from the Eurostat website. This function relies only on `data.table` functions as it is expected that locally stored files may be larger and require more efficient handling with regards to RAM and processing time constrains. `tidy_eurostat_sdmx()` and `parse_filename()` are helper functions related to this function.
* New `legacy_data_format()` function and `legacy.data.output` attribute in `get_eurostat()` and `get_eurostat_local()` transforms modern API naming conventions into the format that was used in the old API and eurostat package versions 3.8.* and prior. It is a helper function to other functions.
* Add internal functions for retrieving SDMX metadata

## Minor updates

* `get_eurostat_geospatial()` documentation mentions that data from 2024 is now available (fixes issue #327 by @yhsong1013)
* Fix mentions to Eurostat base URLs in `check_access_to_data()`, `get_eurostat()`, `get_eurostat_json()`, `get_eurostat_sdmx()`, `label_eurostat()` and `search_eurostat()` (fixes issue #326 by @olivierchantrel)

## Deprecated and defunct

* Remove deprecated parameter `make_valid` from `get_eurostat_geospatial()`

# eurostat 4.0.0

## Major updates
Expand Down Expand Up @@ -70,7 +100,7 @@ downloading geospatial data (PR #264, thanks to @dieghernan):

## Major updates

* Updated `get_eurostat()` and its assorted functions to download data from the new dissemination API (related to issues #251, #243). See Eurostat web page Transition - from Eurostat Bulk Download to API for a list of differences between old and new data sources: https://wikis.ec.europa.eu/display/EUROSTATHELP/Transition+-+from+Eurostat+Bulk+Download+to+API
* Updated `get_eurostat()` and its assorted functions to download data from the new dissemination API (related to issues #251, #243). See Eurostat web page Transition - from Eurostat Bulk Download to API for a list of differences between old and new data sources: https://ec.europa.eu/eurostat/web/user-guides/data-browser/api-data-access/api-migrating/bulkdownload
* Added new temporary functions for downloading and handling data from the new dissemination API: `get_eurostat_raw2`, `tidy_eurostat2`, `convert_time_col2`, `eurotime2date2`, `eurotime2num2` and `label_eurostat2`. When the old bulk download facilities are decommissioned, these functions will replace the old functions with old naming schemes (without the 2s at the end).
* `tidy_eurostat2` function is now able to handle multiple time frequencies in one call: For example, you can download annual, quarterly, and monthly data simply by using a vector c("A", "Q", "M") in select_time instead of using these singular frequencies in separate calls. The function will also return multiple time series in one dataset if select_time is NULL (as it is by default). If the dataset contains multiple time series and these are explicitly downloaded / no select_time parameter is given, a message will be printed.
* `eurotime2num` can now handle monthly and weekly data as well.
Expand All @@ -82,7 +112,7 @@ downloading geospatial data (PR #264, thanks to @dieghernan):

# eurostat 3.7.13 (2023-02-01)

* Updated `get_eurostat_json()` to migrate from JSON web service to API Statistics (addressed in issues #243, #251). Please note that the output from JSON API is now slightly different than before: the datasets now contain a freq column to indicate the frequency with which data has been collected, for example annually "A", monthly "M" or quarterly "Q". See Eurostat - Data browser online help website for more information: https://wikis.ec.europa.eu/display/EUROSTATHELP/API+Statistics+-+migrating+from+JSON+web+service+to+API+Statistics
* Updated `get_eurostat_json()` to migrate from JSON web service to API Statistics (addressed in issues #243, #251). Please note that the output from JSON API is now slightly different than before: the datasets now contain a freq column to indicate the frequency with which data has been collected, for example annually "A", monthly "M" or quarterly "Q". See Eurostat - Data browser online help website for more information: https://ec.europa.eu/eurostat/web/user-guides/data-browser/api-data-access/api-migrating/json
* Minor fixes in `get_bibentry()` and `get_eurostat_geospatial()`

# eurostat 3.7.12 (2022-06-28)
Expand Down
4 changes: 3 additions & 1 deletion R/check_access_to_data.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' @title Check access to ec.europe.eu
#' @title Check access to ec.europa.eu
#' @description Check if R has access to resources at http://ec.europa.eu
#' @author Markus Kainu <markus.kainu@@kapsi.fi>
#' @return a logical.
Expand All @@ -9,12 +9,14 @@
#'
#' @importFrom curl curl_download
#' @importFrom utils download.file
#' @importFrom R.utils isUrl
#'
#' @export

check_access_to_data <- function() {
temp <- tempfile()
http_url <- "https://ec.europa.eu/eurostat/cache/GISCO/distribution/v2/nuts/geojson/NUTS_RG_60M_2006_4326_LEVL_0.geojson"
stopifnot(R.utils::isUrl(http_url))
# If unix use curl::curl_download to test connection
# If windows use download.file with default method 'wininet'
if (.Platform$OS.type == "unix") {
Expand Down
11 changes: 9 additions & 2 deletions R/data_countries.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,16 @@
#' @description Countries and country codes in EU,
#' Euro area, EFTA and EU candidate countries.
#' @format A data_frame:
#' * **code**: Country code in the Eurostat database.
#' * **code**: Country code in the Eurostat database (two-letter ISO code (ISO 3166 alpha-2) except in the case of Greece where EL is used).
#' * **name**: Country name in English.
#' * **label**: Country name in the Eurostat database.
#' * **label**: Country name in the Eurostat database
#' * **name_fr**: Country name in French
#' * **name_de**: Country name in German
#' * **country_language**: Country name in national language(s).
#'
#' @details
#' Country codes are two-letter ISO codes (ISO 3166 alpha-2) except in the case
#' of Greece where EL is used instead of the standard ISO code.
#'
#' @family datasets
#' @source <https://ec.europa.eu/eurostat/statistics-explained/index.php/Tutorial:Country_codes_and_protocol_order>,
Expand Down
Loading