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..ef10ad97 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 @@ -112,6 +117,7 @@ references: 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 +133,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 +147,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 @@ -151,6 +159,7 @@ references: name: R Foundation for Statistical Computing address: Vienna, Austria year: '2024' + doi: 10.32614/CRAN.package.utils - type: software title: dplyr abstract: 'dplyr: A Grammar of Data Manipulation' @@ -175,6 +184,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 +203,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 +243,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 +254,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 +269,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 +282,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 +327,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 +339,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..40532dc6 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,10 @@ +# 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. + # giscoR 0.5.1 - Use **CRAN** DOI: . diff --git a/R/gisco_get_education.R b/R/gisco_get_education.R index d2fa40cb..d271b7d8 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_entry)) 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..0742bcf8 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 @@ -183,6 +186,7 @@ We now download the data from Eurostat: library(eurostat) popdens <- get_eurostat("demo_r_d3dens") %>% filter(TIME_PERIOD == "2021-01-01") +#> indexed 0B in 0s, 0B/sindexed 1.00TB in 0s, 395.58TB/s ``` By last, we merge and manipulate the data for creating the final plot: @@ -326,7 +330,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.}, } @@ -360,8 +364,7 @@ This package is in no way officially related to or endorsed by Eurostat. ## References -
+
diff --git a/codemeta.json b/codemeta.json index a386f102..64e9c5e9 100644 --- a/codemeta.json +++ b/codemeta.json @@ -8,13 +8,13 @@ "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", "url": "https://r-project.org" }, - "runtimePlatform": "R version 4.4.1 (2024-06-14 ucrt)", + "runtimePlatform": "R version 4.4.1 (2024-06-14)", "provider": { "@id": "https://cran.r-project.org", "@type": "Organization", @@ -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": "1250.359KB", "citation": [ { "@type": "SoftwareSourceCode", diff --git a/data/gisco_countrycode.rda b/data/gisco_countrycode.rda index 7934a2ef..96f2dfc1 100644 Binary files a/data/gisco_countrycode.rda and b/data/gisco_countrycode.rda differ diff --git a/data/gisco_db.rda b/data/gisco_db.rda index 48805910..22910165 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..15f47246 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..2a4bc624 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..1c666981 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..20d44698 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..1f65cac2 100644 --- a/inst/schemaorg.json +++ b/inst/schemaorg.json @@ -40,8 +40,8 @@ "name": "Comprehensive R Archive Network (CRAN)", "url": "https://cran.r-project.org" }, - "runtimePlatform": "R version 4.4.1 (2024-06-14 ucrt)", - "version": "0.5.1" + "runtimePlatform": "R version 4.4.1 (2024-06-14)", + "version": "0.5.1.9000" }, { "id": "https://doi.org/10.32614/CRAN.package.giscoR", 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/vignettes/africa-1.png b/vignettes/africa-1.png index 1cab61c5..4855dbc1 100644 Binary files a/vignettes/africa-1.png and b/vignettes/africa-1.png differ diff --git a/vignettes/country-1.png b/vignettes/country-1.png index ecf20668..ea974a58 100644 Binary files a/vignettes/country-1.png and b/vignettes/country-1.png differ diff --git a/vignettes/giscoR-1.png b/vignettes/giscoR-1.png index 50d3657d..00ecbece 100644 Binary files a/vignettes/giscoR-1.png and b/vignettes/giscoR-1.png differ diff --git a/vignettes/giscoR.Rmd b/vignettes/giscoR.Rmd index f413ee3f..b5be6295 100644 --- a/vignettes/giscoR.Rmd +++ b/vignettes/giscoR.Rmd @@ -190,13 +190,18 @@ nuts2_sf <- nuts2 %>% values_th = values / 1000, categ = cut(values_th, c(0, 15, 30, 60, 90, 120, Inf)) ) +#> Error in UseMethod("left_join"): no applicable method for 'left_join' applied to an object of class "NULL" # Adjust the labels labs <- levels(nuts2_sf$categ) +#> Error in eval(expr, envir, enclos): object 'nuts2_sf' not found labs[1] <- "< 15" +#> Error in labs[1] <- "< 15": object of type 'closure' is not subsettable labs[6] <- "> 120" +#> Error in labs[6] <- "> 120": object of type 'closure' is not subsettable levels(nuts2_sf$categ) <- labs +#> Error: object 'nuts2_sf' not found # Finally the plot @@ -249,9 +254,5 @@ ggplot(nuts2_sf) + "Source: Eurostat\n ", gisco_attributions() ) ) +#> Error in eval(expr, envir, enclos): object 'nuts2_sf' not found ``` - -
-Disposable income of private households by NUTS 2 regions (2021) -

Disposable income of private households by NUTS 2 regions (2021)

-