diff --git a/.github/workflows/recheck.yaml b/.github/workflows/recheck.yaml new file mode 100644 index 00000000..83497ede --- /dev/null +++ b/.github/workflows/recheck.yaml @@ -0,0 +1,20 @@ +# Workflow derived from https://github.com/r-devel/recheck +on: + workflow_dispatch: + inputs: + which: + type: choice + description: Which dependents to check + options: + - strong + - most + +name: r-devel reverse dependency check + +jobs: + revdep_check: + name: Reverse check ${{ inputs.which }} dependents + uses: r-devel/recheck/.github/workflows/recheck.yml@v1 + with: + which: ${{ inputs.which }} + diff --git a/CITATION.cff b/CITATION.cff index 2e3dc6b0..b328bc39 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -8,8 +8,11 @@ message: 'To cite package "giscoR" in publications use:' type: software license: GPL-3.0-only title: 'giscoR: Download Map Data from GISCO API - Eurostat' -version: 0.5.1 +version: 0.5.1.9000 doi: 10.32614/CRAN.package.giscoR +identifiers: +- type: doi + value: 10.32614/CRAN.package.giscoR abstract: Tools to download data from the GISCO (Geographic Information System of the Commission) Eurostat database . Global and European map data available. This package is in no way officially related to @@ -31,7 +34,7 @@ preferred-citation: affiliation: rOpenGov doi: 10.32614/CRAN.package.giscoR year: '2024' - version: 0.5.1 + version: 0.5.1.9000 url: https://ropengov.github.io/giscoR/ abstract: Tools to download data from the GISCO (Geographic Information System of the Commission) Eurostat database . Global @@ -84,6 +87,7 @@ references: email: vincent.arel-bundock@umontreal.ca orcid: https://orcid.org/0000-0003-2042-7063 year: '2024' + doi: 10.32614/CRAN.package.countrycode version: '>= 1.2.0' - type: software title: geojsonsf @@ -96,6 +100,7 @@ references: given-names: David email: dcooley@symbolix.com.au year: '2024' + doi: 10.32614/CRAN.package.geojsonsf version: '>= 2.0.0' - type: software title: jsonlite @@ -109,9 +114,7 @@ references: email: jeroen@berkeley.edu orcid: https://orcid.org/0000-0002-4035-0289 year: '2024' - identifiers: - - type: url - value: https://arxiv.org/abs/1403.2805 + doi: 10.32614/CRAN.package.jsonlite - type: software title: rappdirs abstract: 'rappdirs: Application Directories: Determine Where to Save Data, Caches, @@ -127,6 +130,7 @@ references: - family-names: Davis given-names: Trevor year: '2024' + doi: 10.32614/CRAN.package.rappdirs version: '>= 0.3.0' - type: software title: sf @@ -140,6 +144,7 @@ references: email: edzer.pebesma@uni-muenster.de orcid: https://orcid.org/0000-0001-8049-7069 year: '2024' + doi: 10.32614/CRAN.package.sf version: '>= 0.9.0' - type: software title: utils @@ -175,6 +180,7 @@ references: email: davis@posit.co orcid: https://orcid.org/0000-0003-4777-038X year: '2024' + doi: 10.32614/CRAN.package.dplyr - type: software title: eurostat abstract: 'eurostat: Tools for Eurostat Open Data' @@ -193,6 +199,7 @@ references: - family-names: Biecek given-names: Przemyslaw year: '2024' + doi: 10.32614/CRAN.package.eurostat - type: software title: ggplot2 abstract: 'ggplot2: Create Elegant Data Visualisations Using the Grammar of Graphics' @@ -232,6 +239,7 @@ references: name-particle: van den orcid: https://orcid.org/0000-0002-9335-7468 year: '2024' + doi: 10.32614/CRAN.package.ggplot2 version: '>= 3.5.0' - type: software title: httr2 @@ -242,8 +250,9 @@ references: authors: - family-names: Wickham given-names: Hadley - email: hadley@rstudio.com + email: hadley@posit.co year: '2024' + doi: 10.32614/CRAN.package.httr2 - type: software title: knitr abstract: 'knitr: A General-Purpose Package for Dynamic Report Generation in R' @@ -256,6 +265,7 @@ references: email: xie@yihui.name orcid: https://orcid.org/0000-0003-0645-5666 year: '2024' + doi: 10.32614/CRAN.package.knitr - type: software title: lwgeom abstract: 'lwgeom: Bindings to Selected ''liblwgeom'' Functions for Simple Features' @@ -268,6 +278,7 @@ references: email: edzer.pebesma@uni-muenster.de orcid: https://orcid.org/0000-0001-8049-7069 year: '2024' + doi: 10.32614/CRAN.package.lwgeom version: '>= 0.2-2' - type: software title: rmarkdown @@ -312,6 +323,7 @@ references: email: rich@posit.co orcid: https://orcid.org/0000-0003-3925-190X year: '2024' + doi: 10.32614/CRAN.package.rmarkdown - type: software title: testthat abstract: 'testthat: Unit Testing for R' @@ -323,5 +335,6 @@ references: given-names: Hadley email: hadley@posit.co year: '2024' + doi: 10.32614/CRAN.package.testthat version: '>= 3.0.0' diff --git a/DESCRIPTION b/DESCRIPTION index 56d761cd..f25b87ca 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: giscoR Title: Download Map Data from GISCO API - Eurostat -Version: 0.5.1 +Version: 0.5.1.9000 Authors@R: c( person("Diego", "Hernangómez", , "diego.hernangomezherrero@gmail.com", role = c("aut", "cre", "cph"), comment = c(ORCID = "0000-0001-8457-4658", affiliation = "rOpenGov")), diff --git a/NEWS.md b/NEWS.md index 414d4aeb..f6fa01c1 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,12 @@ +# giscoR (development version) + +## Update with latest data available + +- `gisco_get_education()` and `gisco_get_healthcare()` gains a new `year` + argument: years available now are 2020 and 2023 versions of the dataset. +- `gisco_get_nuts()` and `gisco_get_countries()` now can download the 2024 + version of the datasets. + # giscoR 0.5.1 - Use **CRAN** DOI: . diff --git a/R/gisco_get_education.R b/R/gisco_get_education.R index d2fa40cb..085f647a 100644 --- a/R/gisco_get_education.R +++ b/R/gisco_get_education.R @@ -12,7 +12,7 @@ #' @source #' #' -#' @inheritParams gisco_get_countries +#' @inheritParams gisco_get_healthcare #' #' @inheritSection gisco_get_countries About caching #' @@ -34,10 +34,12 @@ #' } #' } #' @export -gisco_get_education <- function(cache = TRUE, update_cache = FALSE, +gisco_get_education <- function(year = c("2023", "2020"), + cache = TRUE, update_cache = FALSE, cache_dir = NULL, verbose = FALSE, country = NULL) { # Given vars + year <- match.arg(year) epsg <- "4326" ext <- "gpkg" @@ -49,15 +51,15 @@ gisco_get_education <- function(cache = TRUE, update_cache = FALSE, api_entry <- paste0( - "https://gisco-services.ec.europa.eu/pub/education/2020/", - "/gpkg/", country_get, ".gpkg" + "https://gisco-services.ec.europa.eu/pub/education/", year, "/gpkg/", + country_get, ".gpkg" ) n_cnt <- seq_len(length(api_entry)) ress <- lapply(n_cnt, function(x) { api <- api_entry[x] - filename <- basename(api) + filename <- paste0("edu_", year, "_", basename(api)) if (cache) { diff --git a/R/gisco_get_healthcare.R b/R/gisco_get_healthcare.R index 84f80e90..503f17de 100644 --- a/R/gisco_get_healthcare.R +++ b/R/gisco_get_healthcare.R @@ -13,6 +13,7 @@ #' @source #' #' +#' @param year Release year of the file. One of `"2020"`, `"2023"` (default). #' @inheritParams gisco_get_countries #' #' @inheritSection gisco_get_countries About caching @@ -35,18 +36,19 @@ #' } #' } #' @export -gisco_get_healthcare <- function(cache = TRUE, update_cache = FALSE, - cache_dir = NULL, verbose = FALSE, - country = NULL) { +gisco_get_healthcare <- function(year = c("2023", "2020"), cache = TRUE, + update_cache = FALSE, cache_dir = NULL, + verbose = FALSE, country = NULL) { # Given vars + year <- match.arg(year) epsg <- "4326" ext <- "gpkg" api_entry <- paste0( - "https://gisco-services.ec.europa.eu/pub/healthcare/2020", + "https://gisco-services.ec.europa.eu/pub/healthcare/", year, "/gpkg/EU.gpkg" ) - filename <- basename(api_entry) + filename <- paste0("health_", year, "_", basename(api_entry)) if (cache) { diff --git a/README.md b/README.md index deafce94..04f4594b 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,9 @@ install.packages("giscoR", ## Usage +You can have a look to the documentation of the dev version in + + This script highlights some features of **giscoR** : ``` r @@ -326,7 +329,7 @@ A BibTeX entry for LaTeX users is doi = {10.32614/CRAN.package.giscoR}, author = {Diego Hernangómez}, year = {2024}, - version = {0.5.1}, + version = {0.5.1.9000}, url = {https://ropengov.github.io/giscoR/}, abstract = {Tools to download data from the GISCO (Geographic Information System of the Commission) Eurostat database . Global and European map data available. This package is in no way officially related to or endorsed by Eurostat.}, } diff --git a/codemeta.json b/codemeta.json index a386f102..22c1ada8 100644 --- a/codemeta.json +++ b/codemeta.json @@ -8,7 +8,7 @@ "codeRepository": "https://github.com/rOpenGov/giscoR", "issueTracker": "https://github.com/rOpenGov/giscoR/issues", "license": "https://spdx.org/licenses/GPL-3.0", - "version": "0.5.1", + "version": "0.5.1.9000", "programmingLanguage": { "@type": "ComputerLanguage", "name": "R", @@ -240,7 +240,7 @@ "applicationCategory": "cartography", "isPartOf": "http://ropengov.org/", "keywords": ["ropengov", "r", "spatial", "api-wrapper", "rstats", "r-package", "eurostat", "gisco", "thematic-maps", "eurostat-data", "cran", "ggplot2", "gis"], - "fileSize": "1257.482KB", + "fileSize": "1258.247KB", "citation": [ { "@type": "SoftwareSourceCode", diff --git a/data/gisco_db.rda b/data/gisco_db.rda index 48805910..5f954174 100644 Binary files a/data/gisco_db.rda and b/data/gisco_db.rda differ diff --git a/img/README-example-1.png b/img/README-example-1.png index 4bd24fa2..b48df24a 100644 Binary files a/img/README-example-1.png and b/img/README-example-1.png differ diff --git a/img/README-example-2.png b/img/README-example-2.png index 4b6cbf62..8e055942 100644 Binary files a/img/README-example-2.png and b/img/README-example-2.png differ diff --git a/img/README-labels-1.png b/img/README-labels-1.png index 2c53689a..5d54504f 100644 Binary files a/img/README-labels-1.png and b/img/README-labels-1.png differ diff --git a/img/README-thematic-1.png b/img/README-thematic-1.png index 44adedd7..2425fc9f 100644 Binary files a/img/README-thematic-1.png and b/img/README-thematic-1.png differ diff --git a/inst/schemaorg.json b/inst/schemaorg.json index d24fbf2f..c5bf3004 100644 --- a/inst/schemaorg.json +++ b/inst/schemaorg.json @@ -41,7 +41,7 @@ "url": "https://cran.r-project.org" }, "runtimePlatform": "R version 4.4.1 (2024-06-14 ucrt)", - "version": "0.5.1" + "version": "0.5.1.9000" }, { "id": "https://doi.org/10.32614/CRAN.package.giscoR", diff --git a/man/gisco_get.Rd b/man/gisco_get.Rd index 8481a6c5..d4f53ee0 100644 --- a/man/gisco_get.Rd +++ b/man/gisco_get.Rd @@ -22,7 +22,7 @@ gisco_get_countries( } \arguments{ \item{year}{Release year of the file. One -of \code{"2001"}, \code{"2006"}, \code{"2010"}, \code{"2013"}, \code{"2016"} or \code{"2020"}.} +of \code{"2001"}, \code{"2006"}, \code{"2010"}, \code{"2013"}, \code{"2016"}, \code{"2020"} or \code{"2024"}.} \item{epsg}{projection of the map: 4-digit \href{https://epsg.io/}{EPSG code}. One of: diff --git a/man/gisco_get_education.Rd b/man/gisco_get_education.Rd index a04ab1d1..3989a9c9 100644 --- a/man/gisco_get_education.Rd +++ b/man/gisco_get_education.Rd @@ -8,6 +8,7 @@ } \usage{ gisco_get_education( + year = c("2023", "2020"), cache = TRUE, update_cache = FALSE, cache_dir = NULL, @@ -16,6 +17,8 @@ gisco_get_education( ) } \arguments{ +\item{year}{Release year of the file. One of \code{"2020"}, \code{"2023"} (default).} + \item{cache}{A logical whether to do caching. Default is \code{TRUE}. See \strong{About caching}.} diff --git a/man/gisco_get_healthcare.Rd b/man/gisco_get_healthcare.Rd index 6b46637a..80285d48 100644 --- a/man/gisco_get_healthcare.Rd +++ b/man/gisco_get_healthcare.Rd @@ -8,6 +8,7 @@ } \usage{ gisco_get_healthcare( + year = c("2023", "2020"), cache = TRUE, update_cache = FALSE, cache_dir = NULL, @@ -16,6 +17,8 @@ gisco_get_healthcare( ) } \arguments{ +\item{year}{Release year of the file. One of \code{"2020"}, \code{"2023"} (default).} + \item{cache}{A logical whether to do caching. Default is \code{TRUE}. See \strong{About caching}.} diff --git a/man/gisco_get_nuts.Rd b/man/gisco_get_nuts.Rd index 480553c1..7fbdc3ca 100644 --- a/man/gisco_get_nuts.Rd +++ b/man/gisco_get_nuts.Rd @@ -23,7 +23,7 @@ gisco_get_nuts( } \arguments{ \item{year}{Release year of the file. One -of \code{"2003"}, \code{"2006"}, \code{"2010"}, \code{"2013"}, \code{"2016"} or \code{"2021"}.} +of \code{"2003"}, \code{"2006"}, \code{"2010"}, \code{"2013"}, \code{"2016"}, \code{"2021"} or \code{"2024"}.} \item{epsg}{projection of the map: 4-digit \href{https://epsg.io/}{EPSG code}. One of: diff --git a/man/gisco_get_units.Rd b/man/gisco_get_units.Rd index 22396125..2f1ca97d 100644 --- a/man/gisco_get_units.Rd +++ b/man/gisco_get_units.Rd @@ -31,7 +31,7 @@ gisco_get_units( or \code{"df"}. See \strong{Value} and \strong{Details}.} \item{year}{Release year of the file. One -of \code{"2001"}, \code{"2006"}, \code{"2010"}, \code{"2013"}, \code{"2016"} or \code{"2020"}.} +of \code{"2001"}, \code{"2006"}, \code{"2010"}, \code{"2013"}, \code{"2016"}, \code{"2020"} or \code{"2024"}.} \item{epsg}{projection of the map: 4-digit \href{https://epsg.io/}{EPSG code}. One of: diff --git a/tests/testthat/test-gisco_get_countries.R b/tests/testthat/test-gisco_get_countries.R index d8a0a580..cdbe516b 100644 --- a/tests/testthat/test-gisco_get_countries.R +++ b/tests/testthat/test-gisco_get_countries.R @@ -44,6 +44,15 @@ test_that("Countries online", { cache = FALSE )) + expect_silent( + gisco_get_countries( + year = 2024, + spatialtype = "BN", + resolution = 60, + cache = TRUE + ) + ) + expect_silent(gisco_get_countries( spatialtype = "COASTL", country = c("ESP", "ITA") diff --git a/tests/testthat/test-gisco_get_nuts.R b/tests/testthat/test-gisco_get_nuts.R index dcd91294..c9afc99f 100644 --- a/tests/testthat/test-gisco_get_nuts.R +++ b/tests/testthat/test-gisco_get_nuts.R @@ -95,6 +95,14 @@ test_that("NUTS online", { expect_equal(epsg3035, sf::st_crs(a)) expect_equal(epsg3857, sf::st_crs(b)) expect_equal(epsg4326, sf::st_crs(c)) + + expect_silent(aa <- + gisco_get_nuts( + year = 2024, + resolution = "60", + nuts_level = "0", + nuts_id = "ES5" + )) }) diff --git a/vignettes/articles/nuts_codes.Rmd b/vignettes/articles/nuts_codes.Rmd index a2d621ca..c226ac80 100644 --- a/vignettes/articles/nuts_codes.Rmd +++ b/vignettes/articles/nuts_codes.Rmd @@ -12,17 +12,34 @@ knitr::opts_chunk$set( message = FALSE, out.width = "100%" ) + +library(giscoR) +library(reactable) ``` Annex with the [NUTS codes](https://ec.europa.eu/eurostat/web/nuts/overview) -(version **2021**, **2016** and **2013**) available in **giscoR**. +(version **2024**, **2021**, **2016** and **2013**) available in **giscoR**. + +## NUTS 2024 + +```{r nuts24, echo=FALSE} +df <- gisco_get_nuts(year = 2024, resolution = 60) +df <- sf::st_drop_geometry(df) +reactable(df, + elementId = "NUTS2024", + filterable = TRUE, + searchable = TRUE, + defaultColDef = colDef(minWidth = 120), + showPageSizeOptions = TRUE, + striped = TRUE, + paginationType = "jump", + defaultSorted = c("LEVL_CODE", "CNTR_CODE") +) +``` ## NUTS 2021 ```{r nuts21, echo=FALSE} -library(giscoR) -library(reactable) - df <- gisco_get_nuts(year = 2021, resolution = 60) df <- sf::st_drop_geometry(df) reactable(df,