diff --git a/CITATION.cff b/CITATION.cff index 74b21d28..a7788374 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -8,7 +8,7 @@ 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.4.0 +version: 0.4.0.9000 doi: 10.5281/zenodo.4317946 abstract: Tools to download data from the GISCO (Geographic Information System of the Commission) Eurostat database . Global @@ -30,8 +30,8 @@ preferred-citation: orcid: https://orcid.org/0000-0001-8457-4658 affiliation: rOpenGov doi: 10.5281/zenodo.4317946 - year: '2023' - version: 0.4.0 + year: '2024' + version: 0.4.0.9000 url: https://ropengov.github.io/giscoR/ abstract: Tools to download data from the GISCO (Geographic Information System of the Commission) Eurostat database . Global @@ -69,7 +69,7 @@ references: - name: R Core Team location: name: Vienna, Austria - year: '2023' + year: '2024' institution: name: R Foundation for Statistical Computing version: '>= 3.6.0' @@ -84,7 +84,7 @@ references: given-names: Vincent email: vincent.arel-bundock@umontreal.ca orcid: https://orcid.org/0000-0003-2042-7063 - year: '2023' + year: '2024' version: '>= 1.2.0' - type: software title: geojsonsf @@ -96,7 +96,7 @@ references: - family-names: Cooley given-names: David email: dcooley@symbolix.com.au - year: '2023' + year: '2024' version: '>= 2.0.0' - type: software title: httr @@ -108,7 +108,7 @@ references: - family-names: Wickham given-names: Hadley email: hadley@posit.co - year: '2023' + year: '2024' - type: software title: rappdirs abstract: 'rappdirs: Application Directories: Determine Where to Save Data, Caches, @@ -123,7 +123,7 @@ references: given-names: Trent - family-names: Davis given-names: Trevor - year: '2023' + year: '2024' version: '>= 0.3.0' - type: software title: sf @@ -136,7 +136,7 @@ references: given-names: Edzer email: edzer.pebesma@uni-muenster.de orcid: https://orcid.org/0000-0001-8049-7069 - year: '2023' + year: '2024' version: '>= 0.9.0' - type: software title: utils @@ -146,7 +146,7 @@ references: - name: R Core Team location: name: Vienna, Austria - year: '2023' + year: '2024' institution: name: R Foundation for Statistical Computing - type: software @@ -166,7 +166,7 @@ references: given-names: Markus - family-names: Biecek given-names: Przemyslaw - year: '2023' + year: '2024' - type: software title: ggplot2 abstract: 'ggplot2: Create Elegant Data Visualisations Using the Grammar of Graphics' @@ -201,7 +201,7 @@ references: - family-names: Dunnington given-names: Dewey orcid: https://orcid.org/0000-0002-9415-4582 - year: '2023' + year: '2024' version: '>= 3.0.0' - type: software title: knitr @@ -214,7 +214,7 @@ references: given-names: Yihui email: xie@yihui.name orcid: https://orcid.org/0000-0003-0645-5666 - year: '2023' + year: '2024' - type: software title: lwgeom abstract: 'lwgeom: Bindings to Selected ''liblwgeom'' Functions for Simple Features' @@ -226,7 +226,7 @@ references: given-names: Edzer email: edzer.pebesma@uni-muenster.de orcid: https://orcid.org/0000-0001-8049-7069 - year: '2023' + year: '2024' version: '>= 0.2-2' - type: software title: rmarkdown @@ -270,7 +270,7 @@ references: given-names: Richard email: rich@posit.co orcid: https://orcid.org/0000-0003-3925-190X - year: '2023' + year: '2024' - type: software title: testthat abstract: 'testthat: Unit Testing for R' @@ -281,5 +281,5 @@ references: - family-names: Wickham given-names: Hadley email: hadley@posit.co - year: '2023' + year: '2024' version: '>= 3.0.0' diff --git a/DESCRIPTION b/DESCRIPTION index a854c656..cbbc0e39 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: giscoR Title: Download Map Data from GISCO API - Eurostat -Version: 0.4.0 +Version: 0.4.0.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 6f2b4ff0..8e8da42f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,8 @@ +# giscoR (development version) + +- Improve documentation, stating where the parameters `country` and `region` + applies (#50, #75) + # giscoR 0.4.0 - `gisco_get_nuts()`: Add an additional `geo` column (identical to `NUTS_ID`) diff --git a/R/data.R b/R/data.R index 8ba054e9..ae0d2c8a 100644 --- a/R/data.R +++ b/R/data.R @@ -10,7 +10,7 @@ #' #' @format A data frame #' -#' @details This dataframe is used to check the validity of the API calls. +#' @details This data frame is used to check the validity of the API calls. #' #' @source GISCO API `datasets.json`. #' @keywords internal @@ -19,14 +19,14 @@ #' data(gisco_db) NULL -#' World countries `POLYGON` object +#' World countries `POLYGON` \CRANpkg{sf} object #' #' @family dataset #' #' @name gisco_countries #' -#' @description A `sf` object including all -#' countries as provided by GISCO (2016 version). +#' @description A \CRANpkg{sf} object including all countries as provided by +#' GISCO (2016 version). #' #' @format #' A `MULTIPOLYGON` data frame (resolution: 1:20million, EPSG:4326) object @@ -64,14 +64,14 @@ NULL #' World coastal lines `POLYGON` object #' -#' A `sf` object as provided by GISCO (2016 version). +#' A \CRANpkg{sf} object as provided by GISCO (2016 version). #' #' @family dataset #' #' @name gisco_coastallines #' #' @format -#' A `POLYGON` data frame (resolution: 1:20million, EPSG:4326) object with +#' A `POLYGON` \CRANpkg{sf} object (resolution: 1:20million, EPSG:4326) with #' 3 variables: #' \describe{ #' \item{COAS_ID}{Coast ID} @@ -113,7 +113,8 @@ NULL #' All NUTS `POLYGON` object #' -#' A `sf` object including all NUTS levels as provided by GISCO (2016 version). +#' A \CRANpkg{sf} object including all NUTS levels as provided by GISCO +#' (2016 version). #' #' @family dataset #' @@ -186,16 +187,16 @@ NULL NULL -#' Dataframe with different country code schemes and world regions +#' Data frame with different country code schemes and world regions #' #' @name gisco_countrycode #' #' @family dataset #' #' @description -#' A dataframe containing conversions between different country +#' A data frame containing conversions between different country #' code schemes (Eurostat/ISO2 and 3) as well as geographic regions as -#' provided by the World Bank and the UN (M49). This dataset +#' provided by the World Bank and the UN (M49). This data set #' is extracted from \CRANpkg{countrycode} package. #' #' @format diff --git a/R/gisco_attributions.R b/R/gisco_attributions.R index bf15447f..0a2433f1 100644 --- a/R/gisco_attributions.R +++ b/R/gisco_attributions.R @@ -1,123 +1,123 @@ -#' Attribution when publishing GISCO data -#' -#' @concept helper -#' @family helper -#' -#' @description -#' Get the legal text to be used along with the data downloaded with this -#' package -#' -#' @export -#' -#' @param lang Language (two-letter ISO code). See -#' and Details. -#' -#' @param copyright -#' Boolean. Whether to display the copyright notice or not on the console. -#' -#' @return A string with the attribution to be used. -#' -#' @details -#' Current languages supported are: -#' * "en" - English -#' * "da" - Danish -#' * "de" - German -#' * "es" - Spanish -#' * "fi" - Finish -#' * "fr" - French -#' * "no" - Norwegian -#' * "sv" - Swedish -#' -#' Please consider -#' [contributing](https://github.com/rOpenGov/giscoR/issues) if you spot any -#' mistake or want to add a new language. -#' -#' @note -#' -#' COPYRIGHT NOTICE -#' -#' When data downloaded from GISCO -#' is used in any printed or electronic publication, -#' in addition to any other provisions -#' applicable to the whole Eurostat website, -#' data source will have to be acknowledged -#' in the legend of the map and -#' in the introductory page of the publication -#' with the following copyright notice: -#' -#' * EN: (C) EuroGeographics for the administrative boundaries -#' * FR: (C) EuroGeographics pour les limites administratives -#' * DE: (C) EuroGeographics bezuglich der Verwaltungsgrenzen -#' -#' For publications in languages other than -#' English, French or German, -#' the translation of the copyright notice -#' in the language of the publication shall be used. -#' -#' If you intend to use the data commercially, -#' please contact EuroGeographics for -#' information regarding their licence agreements. -#' -#' @examples -#' gisco_attributions() -#' -#' gisco_attributions(lang = "es", copyright = TRUE) -#' -#' gisco_attributions(lang = "XXX") -gisco_attributions <- function(lang = "en", copyright = FALSE) { - lang <- tolower(lang) - if (copyright) { - message( - " - COPYRIGHT NOTICE - - When data downloaded from GISCO - is used in any printed or electronic publication, - in addition to any other provisions applicable to - the whole Eurostat website, data source will have - to be acknowledged in the legend of the map and in - the introductory page of the publication with the - following copyright notice: - - - EN: (C) EuroGeographics for the administrative boundaries - - FR: (C) EuroGeographics pour les limites administratives - - DE: (C) EuroGeographics bezuglich der Verwaltungsgrenzen - - For publications in languages other than English, - French or German, the translation of the copyright - notice in the language of the publication shall be - used. - - If you intend to use the data commercially, please - contact EuroGeographics for information regarding - their licence agreements. - - " - ) - } - - # Display message - verbose <- !lang %in% c("en", "da", "de", "es", "fi", "fr", "no", "sv") - - gsc_message( - verbose, "Language", lang, "not supported,", - "switching to English.", - "\nConsider contributing:", - "\nhttps://github.com/rOpenGov/giscoR/issues" - ) - - - - attr <- switch(lang, - "en" = "\u00a9 EuroGeographics for the administrative boundaries", - "da" = "\u00a9 EuroGeographics for administrative gr\u00e6nser", - "de" = "\u00a9 EuroGeographics bezuglich der Verwaltungsgrenzen", - "es" = "\u00a9 Eurogeographics para los l\u00edmites administrativos", - "fi" = "\u00a9 EuroGeographics Association hallinnollisille rajoille", - "fr" = "\u00a9 EuroGeographics pour les limites administratives", - "no" = "\u00a9 EuroGeographics for administrative grenser", - "sv" = "\u00a9 EuroGeographics f\u00f6r administrativa gr\u00e4nser", - "\u00a9 EuroGeographics for the administrative boundaries" - ) - return(attr) -} +#' Attribution when publishing GISCO data +#' +#' @concept helper +#' @family helper +#' +#' @description +#' Get the legal text to be used along with the data downloaded with this +#' package +#' +#' @export +#' +#' @param lang Language (two-letter ISO code). See +#' and Details. +#' +#' @param copyright +#' Boolean. Whether to display the copyright notice or not on the console. +#' +#' @return A string with the attribution to be used. +#' +#' @details +#' Current languages supported are: +#' * `"en"` - English +#' * `"da"` - Danish +#' * `"de"` - German +#' * `"es"` - Spanish +#' * `"fi"` - Finish +#' * `"fr"` - French +#' * `"no"` - Norwegian +#' * `"sv"` - Swedish +#' +#' Please consider +#' [contributing](https://github.com/rOpenGov/giscoR/issues) if you spot any +#' mistake or want to add a new language. +#' +#' @note +#' +#' COPYRIGHT NOTICE +#' +#' When data downloaded from GISCO +#' is used in any printed or electronic publication, +#' in addition to any other provisions +#' applicable to the whole Eurostat website, +#' data source will have to be acknowledged +#' in the legend of the map and +#' in the introductory page of the publication +#' with the following copyright notice: +#' +#' * EN: (C) EuroGeographics for the administrative boundaries +#' * FR: (C) EuroGeographics pour les limites administratives +#' * DE: (C) EuroGeographics bezuglich der Verwaltungsgrenzen +#' +#' For publications in languages other than +#' English, French or German, +#' the translation of the copyright notice +#' in the language of the publication shall be used. +#' +#' If you intend to use the data commercially, +#' please contact EuroGeographics for +#' information regarding their licence agreements. +#' +#' @examples +#' gisco_attributions() +#' +#' gisco_attributions(lang = "es", copyright = TRUE) +#' +#' gisco_attributions(lang = "XXX") +gisco_attributions <- function(lang = "en", copyright = FALSE) { + lang <- tolower(lang) + if (copyright) { + message( + " + COPYRIGHT NOTICE + + When data downloaded from GISCO + is used in any printed or electronic publication, + in addition to any other provisions applicable to + the whole Eurostat website, data source will have + to be acknowledged in the legend of the map and in + the introductory page of the publication with the + following copyright notice: + + - EN: (C) EuroGeographics for the administrative boundaries + - FR: (C) EuroGeographics pour les limites administratives + - DE: (C) EuroGeographics bezuglich der Verwaltungsgrenzen + + For publications in languages other than English, + French or German, the translation of the copyright + notice in the language of the publication shall be + used. + + If you intend to use the data commercially, please + contact EuroGeographics for information regarding + their licence agreements. + + " + ) + } + + # Display message + verbose <- !lang %in% c("en", "da", "de", "es", "fi", "fr", "no", "sv") + + gsc_message( + verbose, "Language", lang, "not supported,", + "switching to English.", + "\nConsider contributing:", + "\nhttps://github.com/rOpenGov/giscoR/issues" + ) + + + + attr <- switch(lang, + "en" = "\u00a9 EuroGeographics for the administrative boundaries", + "da" = "\u00a9 EuroGeographics for administrative gr\u00e6nser", + "de" = "\u00a9 EuroGeographics bezuglich der Verwaltungsgrenzen", + "es" = "\u00a9 Eurogeographics para los l\u00edmites administrativos", + "fi" = "\u00a9 EuroGeographics Association hallinnollisille rajoille", + "fr" = "\u00a9 EuroGeographics pour les limites administratives", + "no" = "\u00a9 EuroGeographics for administrative grenser", + "sv" = "\u00a9 EuroGeographics f\u00f6r administrativa gr\u00e4nser", + "\u00a9 EuroGeographics for the administrative boundaries" + ) + return(attr) +} diff --git a/R/gisco_bulk_download.R b/R/gisco_bulk_download.R index a15e5bfb..94157e8f 100644 --- a/R/gisco_bulk_download.R +++ b/R/gisco_bulk_download.R @@ -9,22 +9,22 @@ #' #' @return Silent function. #' -#' @param year Release year of the file. See Details +#' @param year Release year of the file. See **Details**. #' #' @param id_giscoR Type of dataset to be downloaded. Values supported are: -#' * "coastallines" -#' * "communes" -#' * "countries" -#' * "lau" -#' * "nuts" -#' * "urban_audit" +#' * `"coastallines"` +#' * `"communes"` +#' * `"countries"` +#' * `"lau"` +#' * `"nuts"` +#' * `"urban_audit"` #' #' @inheritParams gisco_get_countries #' #' @inheritSection gisco_get_countries About caching #' #' @param ext Extension of the file(s) to be downloaded. Formats available are -#' "geojson", "shp", "svg", "json", "gdb". See **Details**. +#' `"geojson"`, `"shp"`, `"svg"`, `"json"`, `"gdb"`. See **Details**. #' #' @param recursive Tries to unzip recursively the zip files (if any) included #' in the initial bulk download (case of `ext = "shp"`). @@ -40,7 +40,7 @@ #' * [gisco_get_urban_audit()] #' #' -#' The usual extension used across **giscoR** is "geojson", +#' The usual extension used across \CRANpkg{giscoR} is `"geojson"`, #' however other formats are already available on GISCO. #' #' diff --git a/R/gisco_cache.R b/R/gisco_cache.R index fc911900..c4cd8f11 100644 --- a/R/gisco_cache.R +++ b/R/gisco_cache.R @@ -1,4 +1,4 @@ -#' Set your **giscoR** cache dir +#' Set your \CRANpkg{giscoR} cache dir #' #' @family cache utilities #' @seealso [rappdirs::user_config_dir()] diff --git a/R/gisco_check_access.R b/R/gisco_check_access.R index 0da4e467..c49a1849 100644 --- a/R/gisco_check_access.R +++ b/R/gisco_check_access.R @@ -3,7 +3,7 @@ #' @concept helper #' #' @description -#' Check if R has access to resources at +#' Check if **R** has access to resources at #' . #' #' @return a logical. diff --git a/R/gisco_clear_cache.R b/R/gisco_clear_cache.R index a08a7a5e..e4a0d63b 100644 --- a/R/gisco_clear_cache.R +++ b/R/gisco_clear_cache.R @@ -1,69 +1,71 @@ -#' Clear your **giscoR** cache dir -#' -#' @name gisco_clear_cache -#' @family cache utilities -#' -#' @return Invisible. This function is called for its side effects. -#' -#' @description -#' **Use this function with caution**. This function would clear your cached -#' data and configuration, specifically: -#' -#' * Deletes the **giscoR** config directory -#' (`rappdirs::user_config_dir("giscoR", "R")`). -#' * Deletes the `cache_dir` directory. -#' * Deletes the values on stored on `Sys.getenv("GISCO_CACHE_DIR")` and -#' `options(gisco_cache_dir)`. -#' -#' @param config if `TRUE`, will delete the configuration folder of -#' **giscoR**. -#' @param cached_data If this is set to `TRUE`, it will delete your -#' `cache_dir` and all its content. -#' @inheritParams gisco_set_cache_dir -#' -#' @details -#' This is an overkill function that is intended to reset your status -#' as it you would never have installed and/or used **giscoR**. -#' -#' @examples -#' -#' # Don't run this! It would modify your current state -#' \dontrun{ -#' gisco_clear_cache(verbose = TRUE) -#' -#' Sys.getenv("GISCO_CACHE_DIR") -#' -#' # Set new cache on a temp dir -#' newcache <- file.path(tempdir(), "giscoR", "pkgdown") -#' -#' newcache -#' -#' gisco_set_cache_dir(newcache) -#' -#' Sys.getenv("GISCO_CACHE_DIR") -#' } -#' @export -gisco_clear_cache <- function(config = FALSE, - cached_data = TRUE, - verbose = FALSE) { - # nocov start - config_dir <- rappdirs::user_config_dir("giscoR", "R") - data_dir <- gsc_helper_detect_cache_dir() - if (config && dir.exists(config_dir)) { - unlink(config_dir, recursive = TRUE, force = TRUE) - - gsc_message(verbose, "giscoR cache config deleted") - } - # nocov end - if (cached_data && dir.exists(data_dir)) { - unlink(data_dir, recursive = TRUE, force = TRUE) - gsc_message(verbose, "giscoR cached data deleted: ", data_dir) - } - - - Sys.setenv(GISCO_CACHE_DIR = "") - options(gisco_cache_dir = NULL) - - # Reset cache dir - return(invisible()) -} +#' Clear your \CRANpkg{giscoR} cache dir +#' +#' @name gisco_clear_cache +#' @family cache utilities +#' +#' @return Invisible. This function is called for its side effects. +#' +#' @description +#' **Use this function with caution**. This function would clear your cached +#' data and configuration, specifically: +#' +#' * Deletes the \CRANpkg{giscoR} config directory +#' (`rappdirs::user_config_dir("giscoR", "R")`). +#' * Deletes the `cache_dir` directory. +#' * Deletes the values on stored on `Sys.getenv("GISCO_CACHE_DIR")` and +#' `options(gisco_cache_dir)`. +#' +#' @param config if `TRUE`, will delete the configuration folder of +#' \CRANpkg{giscoR}. +#' @param cached_data If this is set to `TRUE`, it will delete your +#' `cache_dir` and all its content. +#' @inheritParams gisco_set_cache_dir +#' +#' @seealso [rappdirs::user_config_dir()] +#' +#' @details +#' This is an overkill function that is intended to reset your status +#' as it you would never have installed and/or used \CRANpkg{giscoR}. +#' +#' @examples +#' +#' # Don't run this! It would modify your current state +#' \dontrun{ +#' gisco_clear_cache(verbose = TRUE) +#' +#' Sys.getenv("GISCO_CACHE_DIR") +#' +#' # Set new cache on a temp dir +#' newcache <- file.path(tempdir(), "giscoR", "pkgdown") +#' +#' newcache +#' +#' gisco_set_cache_dir(newcache) +#' +#' Sys.getenv("GISCO_CACHE_DIR") +#' } +#' @export +gisco_clear_cache <- function(config = FALSE, + cached_data = TRUE, + verbose = FALSE) { + # nocov start + config_dir <- rappdirs::user_config_dir("giscoR", "R") + data_dir <- gsc_helper_detect_cache_dir() + if (config && dir.exists(config_dir)) { + unlink(config_dir, recursive = TRUE, force = TRUE) + + gsc_message(verbose, "giscoR cache config deleted") + } + # nocov end + if (cached_data && dir.exists(data_dir)) { + unlink(data_dir, recursive = TRUE, force = TRUE) + gsc_message(verbose, "giscoR cached data deleted: ", data_dir) + } + + + Sys.setenv(GISCO_CACHE_DIR = "") + options(gisco_cache_dir = NULL) + + # Reset cache dir + return(invisible()) +} diff --git a/R/gisco_get_airports.R b/R/gisco_get_airports.R index 556318b8..48396000 100644 --- a/R/gisco_get_airports.R +++ b/R/gisco_get_airports.R @@ -1,13 +1,13 @@ #' Get location of airports and ports from GISCO API #' -#' Loads a `sf` object from GISCO API or your local library. +#' Loads a \CRANpkg{sf} object from GISCO API or your local library. #' #' @concept infrastructure #' @family infrastructure #' #' @return A `POINT` object on EPSG:4326. #' -#' @param year Year of reference. Only year available right now is "2013". +#' @param year Year of reference. Only year available right now is `"2013"`. #' #' @inheritParams gisco_get_countries #' diff --git a/R/gisco_get_coastallines.R b/R/gisco_get_coastallines.R index 5bc1ceb0..3de95790 100644 --- a/R/gisco_get_coastallines.R +++ b/R/gisco_get_coastallines.R @@ -1,11 +1,11 @@ -#' Get GISCO coastlines `sf` polygons +#' Get GISCO coastlines \CRANpkg{sf} polygons #' #' Downloads worldwide coastlines #' #' @concept political #' @family political #' -#' @param year Release year. One of "2006", "2010", "2013" or "2016" +#' @param year Release year. One of `"2006"`, `"2010"`, `"2013"` or `"2016"`. #' #' @inheritParams gisco_get_countries #' @@ -13,7 +13,7 @@ #' #' @source #' -#' @return A `sf` `POLYGON` object. +#' @return A \CRANpkg{sf} `POLYGON` object. #' #' @note #' Please check the download and usage provisions on [gisco_attributions()]. diff --git a/R/gisco_get_countries.R b/R/gisco_get_countries.R index 69435c72..43cd9269 100644 --- a/R/gisco_get_countries.R +++ b/R/gisco_get_countries.R @@ -1,4 +1,4 @@ -#' Get GISCO world country `sf` polygons, points and lines +#' Get GISCO world country \CRANpkg{sf} polygons, points and lines #' #' @description #' Returns world country polygons, lines and points at a specified scale, as @@ -39,17 +39,17 @@ #' `region = "EU"` to get the EU members (reference date: 2021). #' #' -#' @return A `sf` object specified by `spatialtype`. +#' @return A \CRANpkg{sf} object specified by `spatialtype`. #' -#' @param year Release year of the file. One of "2001", "2006", -#' "2010", "2013", "2016" or "2020". +#' @param year Release year of the file. One of `"2001"`, `"2006"`, +#' `"2010"`, `"2013"`, `"2016"` or `"2020"`. #' #' @param epsg projection of the map: 4-digit [EPSG code](https://epsg.io/). #' One of: -#' * "4258": ETRS89 -#' * "4326": WGS84 -#' * "3035": ETRS89 / ETRS-LAEA -#' * "3857": Pseudo-Mercator +#' * `"4258"`: ETRS89 +#' * `"4326"`: WGS84 +#' * `"3035"`: ETRS89 / ETRS-LAEA +#' * `"3857"`: Pseudo-Mercator #' #' @param cache A logical whether to do caching. Default is `TRUE`. See #' **About caching**. @@ -61,11 +61,14 @@ #' @param cache_dir A path to a cache directory. See **About caching**. #' #' @param spatialtype Type of geometry to be returned: -#' * **"BN"**: Boundaries - `LINESTRING` object. -#' * **"COASTL"**: coastlines - `LINESTRING` object. -#' * **"INLAND"**: inland boundaries - `LINESTRING` object. -#' * **"LB"**: Labels - `POINT` object. -#' * **"RG"**: Regions - `MULTIPOLYGON/POLYGON` object. +#' * `"BN"`: Boundaries - `LINESTRING` object. +#' * `"COASTL"`: coastlines - `LINESTRING` object. +#' * `"INLAND"`: inland boundaries - `LINESTRING` object. +#' * `"LB"`: Labels - `POINT` object. +#' * `"RG"`: Regions - `MULTIPOLYGON/POLYGON` object. +#' +#' **Note that** parameters `country` and `region` would be only applied +#' when `spatialtype` is `"BN"` or `"RG"`. #' #' @param country Optional. A character vector of country codes. It could be #' either a vector of country names, a vector of ISO3 country codes or a @@ -76,16 +79,17 @@ #' default is `FALSE`. #' #' @param resolution Resolution of the geospatial data. One of -#' * "60": 1:60million -#' * "20": 1:20million -#' * "10": 1:10million -#' * "03": 1:3million -#' * "01": 1:1million +#' * `"60"`: 1:60million +#' * `"20"`: 1:20million +#' * `"10"`: 1:10million +#' * `"03"`: 1:3million +#' * `"01"`: 1:1million #' #' @param region Optional. A character vector of UN M49 region codes or -#' European Union membership. Possible values are "Africa", "Americas", -#' "Asia", "Europe", "Oceania" or "EU" for countries belonging to the European -#' Union (as per 2021). See **About world regions** and [gisco_countrycode] +#' European Union membership. Possible values are `"Africa"`, `"Americas"`, +#' `"Asia"`, `"Europe"`, `"Oceania"` or `"EU"` for countries belonging to the +#' European Union (as per 2021). See **About world regions** and +#' [gisco_countrycode]. #' #' @seealso [gisco_countrycode()], [gisco_countries], #' [countrycode::countrycode()] diff --git a/R/gisco_get_grid.R b/R/gisco_get_grid.R index 52853d0a..e079ee85 100644 --- a/R/gisco_get_grid.R +++ b/R/gisco_get_grid.R @@ -7,7 +7,7 @@ #' #' @concept misc #' -#' @return A `POLYGON/POINT` object. +#' @return A `POLYGON/POINT` \CRANpkg{sf} object. #' #' @author dieghernan, #' @@ -15,9 +15,9 @@ #' #' #' @param resolution Resolution of the grid cells on kms. Available values are -#' "1", "2", "5", "10", "20", "50", "100". See Details +#' `"1"`, `"2"`, `"5"`, `"10"`, `"20"`, `"50"`, `"100"`. See **Details**. #' -#' @param spatialtype Select one of "REGION" or "POINT". +#' @param spatialtype Select one of `"REGION"` or `"POINT"`. #' #' @inheritParams gisco_get_countries #' diff --git a/R/gisco_get_healthcare.R b/R/gisco_get_healthcare.R index 7a198a6a..92753ee6 100644 --- a/R/gisco_get_healthcare.R +++ b/R/gisco_get_healthcare.R @@ -7,7 +7,7 @@ #' The dataset contains information on main healthcare services considered to #' be 'hospitals' by Member States. #' -#' @return A `POINT` object. +#' @return A `POINT` \CRANpkg{sf} object. #' #' @author dieghernan, #' diff --git a/R/gisco_get_lau.R b/R/gisco_get_lau.R index 15c04aa5..98d88394 100644 --- a/R/gisco_get_lau.R +++ b/R/gisco_get_lau.R @@ -1,4 +1,4 @@ -#' Get GISCO urban areas `sf` polygons, points and lines +#' Get GISCO urban areas \CRANpkg{sf} polygons, points and lines #' #' @description #' [gisco_get_communes()] and [gisco_get_lau()] download shapes of Local @@ -11,10 +11,10 @@ #' @concept political #' @family political #' -#' @return A `sf` object specified by `spatialtype`. In the case of +#' @return A \CRANpkg{sf} object specified by `spatialtype`. In the case of #' [gisco_get_lau()], a `POLYGON` object. #' -#' @param year Release year of the file. See Details. +#' @param year Release year of the file. See **Details**. #' #' @param gisco_id Optional. A character vector of GISCO_ID LAU values. #' @@ -23,14 +23,14 @@ #' @inheritSection gisco_get_countries About caching #' #' @details -#' Valid years for eacg function are: -#' * **`gisco_get_communes`**: one of '2001', '2004', '2006', '2008', '2010', -#' '2013' or '2016'. +#' Valid years for each function are: +#' * **`gisco_get_communes`**: one of `"2001"`, `"2004"`, `"2006"`, `"2008"`, +#' `"2010"`, `"2013"` or `"2016"`. #' * **`gisco_get_lau`**: one of #' #' ```{r, echo=FALSE, results= "asis"} #' cat(paste0( -#' paste0("'", (2011:2020), "'", collapse = ", "), +#' paste0('`"', (2011:2020), '"`', collapse = ", "), #' ".") #' ) #' diff --git a/R/gisco_get_nuts.R b/R/gisco_get_nuts.R index 58805d20..c33132e1 100644 --- a/R/gisco_get_nuts.R +++ b/R/gisco_get_nuts.R @@ -1,15 +1,16 @@ -#' Get GISCO NUTS `sf` polygons, points and lines +#' Get GISCO NUTS \CRANpkg{sf} polygons, points and lines #' #' @description #' Returns -#' [NUTS regions](https://en.wikipedia.org/wiki/Nomenclature_of_Territorial_Units_for_Statistics) +#' [NUTS +#' regions](https://en.wikipedia.org/wiki/Nomenclature_of_Territorial_Units_for_Statistics) #' polygons, lines and points at a specified scale, as provided by GISCO. #' #' NUTS are provided at three different levels: -#' * **"0"**: Country level -#' * **"1"**: Groups of states/regions -#' * **"2"**: States/regions -#' * **"3"**: Counties/provinces/districts +#' * `"0"`: Country level +#' * `"1"`: Groups of states/regions +#' * `"2"`: States/regions +#' * `"3"`: Counties/provinces/districts #' #' Note that NUTS-level definition may vary across countries. See also #' . @@ -17,22 +18,26 @@ #' @concept political #' @family political #' -#' @return A `sf` object specified by `spatialtype`. The resulting `sf` object -#' would present an additional column `geo` (equal to `NUTS_ID`) for -#' improving compatibility with \CRANpkg{eurostat} package. See -#' [eurostat::get_eurostat_geospatial()]). See also [gisco_nuts] to -#' understand the columns and values provided. +#' @return A \CRANpkg{sf} object specified by `spatialtype`. The resulting +#' \CRANpkg{sf} object would present an additional column `geo` (equal to +#' `NUTS_ID`) for improving compatibility with \CRANpkg{eurostat} package. See +#' [eurostat::get_eurostat_geospatial()]). #' -#' @param year Release year of the file. One of "2003", "2006, -#' "2010", "2013", "2016" or "2021". +#' See also [gisco_nuts] to understand the columns and values provided. +#' +#' @param year Release year of the file. One of `"2003"`, `"2006"`, `"2010"`, +#' `"2013"`, `"2016"` or `"2021"`. #' #' @param spatialtype Type of geometry to be returned: -#' * **"BN"**: Boundaries - `LINESTRING` object. -#' * **"LB"**: Labels - `POINT` object. -#' * **"RG"**: Regions - `MULTIPOLYGON/POLYGON` object. +#' * `"BN"`: Boundaries - `LINESTRING` object. +#' * `"LB"`: Labels - `POINT` object. +#' * `"RG"`: Regions - `MULTIPOLYGON/POLYGON` object. +#' +#' **Note that** parameters `country`, `nuts_level` and `nuts_id` would be only +#' applied when `spatialtype` is `"BN"` or `"RG"`. #' -#' @param nuts_level NUTS level. One of "0", "1", "2" or "3". -#' See Description. +#' @param nuts_level NUTS level. One of `"0"`, `"1"`, `"2"` or `"3"`. +#' See **Description**. #' #' @param nuts_id Optional. A character vector of NUTS IDs. #' diff --git a/R/gisco_get_postalcodes.R b/R/gisco_get_postalcodes.R index 68063302..9d0bdf07 100644 --- a/R/gisco_get_postalcodes.R +++ b/R/gisco_get_postalcodes.R @@ -2,14 +2,14 @@ #' #' Get postal codes points of the EU, EFTA and candidate countries. #' -#' @param year Year of reference. Currently only "2020" is available. +#' @param year Year of reference. Currently only `"2020"` is available. #' #' @inheritParams gisco_get_airports #' @inheritSection gisco_get_countries About caching #' #' @family political #' -#' @return A `POINT` object on EPSG:4326. +#' @return A `POINT` \CRANpkg{sf} object on EPSG:4326. #' #' @export #' diff --git a/R/gisco_get_units.R b/R/gisco_get_units.R index 792782e5..864b99c1 100644 --- a/R/gisco_get_units.R +++ b/R/gisco_get_units.R @@ -10,29 +10,29 @@ #' @family political #' #' @return -#' A `sf` object on `mode = "sf"` or a dataframe on `mode = "df"`. +#' A \CRANpkg{sf} object on `mode = "sf"` or a data frame on `mode = "df"`. #' -#' @param id_giscoR Select the `unit` type to be downloaded. -#' Accepted values are "nuts", "countries" or "urban_audit". +#' @param id_giscoR Select the `unit` type to be downloaded. Accepted values are +#' `"nuts"`, `"countries"` or `"urban_audit"`. #' -#' @param unit Unit ID to be downloaded. See Details. +#' @param unit Unit ID to be downloaded. See **Details**. #' -#' @param mode Controls the output of the function. Possible values are "sf" -#' or "df". See Value and Details. +#' @param mode Controls the output of the function. Possible values are `"sf"` +#' or `"df"`. See **Value** and **Details**. #' -#' @param spatialtype Type of geometry to be returned: "RG", for `POLYGON` and -#' "LB" for `POINT`. +#' @param spatialtype Type of geometry to be returned: `"RG"`, for `POLYGON` and +#' `"LB"` for `POINT`. #' #' @inheritParams gisco_get_countries #' #' @inheritSection gisco_get_countries About caching #' #' @details -#' The function can return a dataframe on `mode = "df"` or a `sf` object -#' on `mode = "sf"`. +#' The function can return a data frame on `mode = "df"` or a \CRANpkg{sf} +#' object on `mode = "sf"`. #' #' In order to see the available `unit` ids with the required -#' combination of `spatialtype, year`, first run the function on "df" +#' combination of `spatialtype, year`, first run the function on `"df"` #' mode. Once that you get the data frame you can select the required ids #' on the `unit` parameter. #' diff --git a/R/gisco_get_urban_audit.R b/R/gisco_get_urban_audit.R index 3f1f6ee4..7670e4ca 100644 --- a/R/gisco_get_urban_audit.R +++ b/R/gisco_get_urban_audit.R @@ -1,4 +1,5 @@ -#' Get GISCO greater cities and metropolitan areas `sf` polygons and points +#' Get GISCO greater cities and metropolitan areas \CRANpkg{sf} polygons and +#' points #' #' @description #' Returns polygons and points corresponding to cities, greater cities and @@ -9,17 +10,17 @@ #' @concept political #' @family political #' -#' @return A `sf` object specified by `spatialtype`. +#' @return A \CRANpkg{sf} object specified by `spatialtype`. #' -#' @param year Release year of the file. One of "2001", "2004", -#' "2014", "2018" or "2020". +#' @param year Release year of the file. One of `"2001"`, `"2004"`, `"2014"`, +#' `"2018"` or `"2020"`. #' #' @param spatialtype Type of geometry to be returned: -#' * **"LB"**: Labels - `POINT` object. -#' * **"RG"**: Regions - `MULTIPOLYGON/POLYGON` object. +#' * `"LB"`: Labels - `POINT` object. +#' * `"RG"`: Regions - `MULTIPOLYGON/POLYGON` object. #' -#' @param level Level of Urban Audit. Possible values are "CITIES", "FUA", -#' "GREATER_CITIES" or `NULL`, that would download the full dataset. +#' @param level Level of Urban Audit. Possible values are `"CITIES"`, `"FUA"`, +#' `"GREATER_CITIES"` or `NULL`, that would download the full dataset. #' #' @inheritParams gisco_get_countries #' diff --git a/README.md b/README.md index c852e6aa..72d4d114 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,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 @@ -322,7 +325,7 @@ Contributions are very welcome: To cite ‘giscoR’ in publications use: -Hernangómez D (2023). *giscoR: Download Map Data from GISCO API - +Hernangómez D (2024). *giscoR: Download Map Data from GISCO API - Eurostat*. , . @@ -333,8 +336,8 @@ A BibTeX entry for LaTeX users is title = {{giscoR}: Download Map Data from GISCO API - Eurostat}, doi = {10.5281/zenodo.4317946}, author = {Diego Hernangómez}, - year = {2023}, - version = {0.4.0}, + year = {2024}, + version = {0.4.0.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 776d64bf..e44e3ce3 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.4.0", + "version": "0.4.0.9000", "programmingLanguage": { "@type": "ComputerLanguage", "name": "R", @@ -216,11 +216,11 @@ "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": "1422.388KB", + "fileSize": "1423.946KB", "citation": [ { "@type": "SoftwareSourceCode", - "datePublished": "2023", + "datePublished": "2024", "author": [ { "@type": "Person", diff --git a/inst/WORDLIST b/inst/WORDLIST index 2a13794e..b6f72de0 100644 --- a/inst/WORDLIST +++ b/inst/WORDLIST @@ -1,9 +1,9 @@ Arel BN Bundock +CMD CNTR COAS -COASTL COmmission CodeFactor DOI @@ -34,33 +34,22 @@ WGS administratives bezuglich bezüglich -coastallines codecov codelist config countrycode -da -de der -dev df dieghernan dir -eacg eurostat -fi -gdb geojson geospatial gisco giscoR’ -json +httr kms -lau les licence limites rOG -shp -sv -svg diff --git a/inst/schemaorg.json b/inst/schemaorg.json index 026426e3..4297ed6c 100644 --- a/inst/schemaorg.json +++ b/inst/schemaorg.json @@ -41,7 +41,7 @@ "url": "https://cran.r-project.org" }, "runtimePlatform": "R version 4.3.2 (2023-10-31 ucrt)", - "version": "0.4.0" + "version": "0.4.0.9000" }, { "id": "https://doi.org/10.5281/zenodo.4317946", diff --git a/man/gisco_attributions.Rd b/man/gisco_attributions.Rd index 5b24fffe..4ff1e696 100644 --- a/man/gisco_attributions.Rd +++ b/man/gisco_attributions.Rd @@ -22,14 +22,14 @@ package \details{ Current languages supported are: \itemize{ -\item "en" - English -\item "da" - Danish -\item "de" - German -\item "es" - Spanish -\item "fi" - Finish -\item "fr" - French -\item "no" - Norwegian -\item "sv" - Swedish +\item \code{"en"} - English +\item \code{"da"} - Danish +\item \code{"de"} - German +\item \code{"es"} - Spanish +\item \code{"fi"} - Finish +\item \code{"fr"} - French +\item \code{"no"} - Norwegian +\item \code{"sv"} - Swedish } Please consider diff --git a/man/gisco_bulk_download.Rd b/man/gisco_bulk_download.Rd index 5f21d4cf..8957d494 100644 --- a/man/gisco_bulk_download.Rd +++ b/man/gisco_bulk_download.Rd @@ -21,15 +21,15 @@ gisco_bulk_download( \arguments{ \item{id_giscoR}{Type of dataset to be downloaded. Values supported are: \itemize{ -\item "coastallines" -\item "communes" -\item "countries" -\item "lau" -\item "nuts" -\item "urban_audit" +\item \code{"coastallines"} +\item \code{"communes"} +\item \code{"countries"} +\item \code{"lau"} +\item \code{"nuts"} +\item \code{"urban_audit"} }} -\item{year}{Release year of the file. See Details} +\item{year}{Release year of the file. See \strong{Details}.} \item{cache_dir}{A path to a cache directory. See \strong{About caching}.} @@ -42,15 +42,15 @@ default is \code{FALSE}.} \item{resolution}{Resolution of the geospatial data. One of \itemize{ -\item "60": 1:60million -\item "20": 1:20million -\item "10": 1:10million -\item "03": 1:3million -\item "01": 1:1million +\item \code{"60"}: 1:60million +\item \code{"20"}: 1:20million +\item \code{"10"}: 1:10million +\item \code{"03"}: 1:3million +\item \code{"01"}: 1:1million }} \item{ext}{Extension of the file(s) to be downloaded. Formats available are -"geojson", "shp", "svg", "json", "gdb". See \strong{Details}.} +\code{"geojson"}, \code{"shp"}, \code{"svg"}, \code{"json"}, \code{"gdb"}. See \strong{Details}.} \item{recursive}{Tries to unzip recursively the zip files (if any) included in the initial bulk download (case of \code{ext = "shp"}).} @@ -72,7 +72,7 @@ See the years available in the corresponding functions: \item \code{\link[=gisco_get_urban_audit]{gisco_get_urban_audit()}} } -The usual extension used across \strong{giscoR} is "geojson", +The usual extension used across \CRANpkg{giscoR} is \code{"geojson"}, however other formats are already available on GISCO. } \section{About caching}{ diff --git a/man/gisco_check_access.Rd b/man/gisco_check_access.Rd index e0b525d2..9a3c8ced 100644 --- a/man/gisco_check_access.Rd +++ b/man/gisco_check_access.Rd @@ -10,7 +10,7 @@ gisco_check_access() a logical. } \description{ -Check if R has access to resources at +Check if \strong{R} has access to resources at \url{https://gisco-services.ec.europa.eu/distribution/v2/}. } \examples{ diff --git a/man/gisco_clear_cache.Rd b/man/gisco_clear_cache.Rd index cf756503..05ac3e4a 100644 --- a/man/gisco_clear_cache.Rd +++ b/man/gisco_clear_cache.Rd @@ -2,13 +2,13 @@ % Please edit documentation in R/gisco_clear_cache.R \name{gisco_clear_cache} \alias{gisco_clear_cache} -\title{Clear your \strong{giscoR} cache dir} +\title{Clear your \CRANpkg{giscoR} cache dir} \usage{ gisco_clear_cache(config = FALSE, cached_data = TRUE, verbose = FALSE) } \arguments{ \item{config}{if \code{TRUE}, will delete the configuration folder of -\strong{giscoR}.} +\CRANpkg{giscoR}.} \item{cached_data}{If this is set to \code{TRUE}, it will delete your \code{cache_dir} and all its content.} @@ -23,7 +23,7 @@ Invisible. This function is called for its side effects. \strong{Use this function with caution}. This function would clear your cached data and configuration, specifically: \itemize{ -\item Deletes the \strong{giscoR} config directory +\item Deletes the \CRANpkg{giscoR} config directory (\code{rappdirs::user_config_dir("giscoR", "R")}). \item Deletes the \code{cache_dir} directory. \item Deletes the values on stored on \code{Sys.getenv("GISCO_CACHE_DIR")} and @@ -32,7 +32,7 @@ data and configuration, specifically: } \details{ This is an overkill function that is intended to reset your status -as it you would never have installed and/or used \strong{giscoR}. +as it you would never have installed and/or used \CRANpkg{giscoR}. } \examples{ @@ -53,6 +53,8 @@ Sys.getenv("GISCO_CACHE_DIR") } } \seealso{ +\code{\link[rappdirs:user_data_dir]{rappdirs::user_config_dir()}} + Other cache utilities: \code{\link{gisco_detect_cache_dir}()}, \code{\link{gisco_set_cache_dir}()} diff --git a/man/gisco_coastallines.Rd b/man/gisco_coastallines.Rd index 0c2b8295..08149b75 100644 --- a/man/gisco_coastallines.Rd +++ b/man/gisco_coastallines.Rd @@ -5,7 +5,7 @@ \alias{gisco_coastallines} \title{World coastal lines \code{POLYGON} object} \format{ -A \code{POLYGON} data frame (resolution: 1:20million, EPSG:4326) object with +A \code{POLYGON} \CRANpkg{sf} object (resolution: 1:20million, EPSG:4326) with 3 variables: \describe{ \item{COAS_ID}{Coast ID} @@ -18,7 +18,7 @@ A \code{POLYGON} data frame (resolution: 1:20million, EPSG:4326) object with file. } \description{ -A \code{sf} object as provided by GISCO (2016 version). +A \CRANpkg{sf} object as provided by GISCO (2016 version). } \examples{ diff --git a/man/gisco_countries.Rd b/man/gisco_countries.Rd index 51ba0d97..be7725ff 100644 --- a/man/gisco_countries.Rd +++ b/man/gisco_countries.Rd @@ -4,7 +4,7 @@ \encoding{UTF-8} \name{gisco_countries} \alias{gisco_countries} -\title{World countries \code{POLYGON} object} +\title{World countries \code{POLYGON} \CRANpkg{sf} object} \format{ A \code{MULTIPOLYGON} data frame (resolution: 1:20million, EPSG:4326) object with 257 rows and 7 variables: @@ -24,8 +24,8 @@ GISCO} file. } \description{ -A \code{sf} object including all -countries as provided by GISCO (2016 version). +A \CRANpkg{sf} object including all countries as provided by +GISCO (2016 version). } \examples{ diff --git a/man/gisco_countrycode.Rd b/man/gisco_countrycode.Rd index f7b2adc2..812b6c97 100644 --- a/man/gisco_countrycode.Rd +++ b/man/gisco_countrycode.Rd @@ -3,7 +3,7 @@ \docType{data} \name{gisco_countrycode} \alias{gisco_countrycode} -\title{Dataframe with different country code schemes and world regions} +\title{Data frame with different country code schemes and world regions} \format{ A data frame object with 249 rows and 13 variables: \describe{ @@ -27,9 +27,9 @@ Locale Data Repository.} \link[countrycode:codelist]{countrycode::codelist} \strong{v1.2.0}. } \description{ -A dataframe containing conversions between different country +A data frame containing conversions between different country code schemes (Eurostat/ISO2 and 3) as well as geographic regions as -provided by the World Bank and the UN (M49). This dataset +provided by the World Bank and the UN (M49). This data set is extracted from \CRANpkg{countrycode} package. } \examples{ diff --git a/man/gisco_db.Rd b/man/gisco_db.Rd index 3eaefb65..6f372eeb 100644 --- a/man/gisco_db.Rd +++ b/man/gisco_db.Rd @@ -14,7 +14,7 @@ GISCO API \code{datasets.json}. Database with the list of files that the package can load. } \details{ -This dataframe is used to check the validity of the API calls. +This data frame is used to check the validity of the API calls. } \examples{ diff --git a/man/gisco_get.Rd b/man/gisco_get.Rd index 8e694e68..ec573c29 100644 --- a/man/gisco_get.Rd +++ b/man/gisco_get.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/gisco_get_countries.R \name{gisco_get_countries} \alias{gisco_get_countries} -\title{Get GISCO world country \code{sf} polygons, points and lines} +\title{Get GISCO world country \CRANpkg{sf} polygons, points and lines} \source{ \url{https://gisco-services.ec.europa.eu/distribution/v2/} } @@ -21,16 +21,16 @@ gisco_get_countries( ) } \arguments{ -\item{year}{Release year of the file. One of "2001", "2006", -"2010", "2013", "2016" or "2020".} +\item{year}{Release year of the file. One of \code{"2001"}, \code{"2006"}, +\code{"2010"}, \code{"2013"}, \code{"2016"} or \code{"2020"}.} \item{epsg}{projection of the map: 4-digit \href{https://epsg.io/}{EPSG code}. One of: \itemize{ -\item "4258": ETRS89 -\item "4326": WGS84 -\item "3035": ETRS89 / ETRS-LAEA -\item "3857": Pseudo-Mercator +\item \code{"4258"}: ETRS89 +\item \code{"4326"}: WGS84 +\item \code{"3035"}: ETRS89 / ETRS-LAEA +\item \code{"3857"}: Pseudo-Mercator }} \item{cache}{A logical whether to do caching. Default is \code{TRUE}. See @@ -47,21 +47,24 @@ default is \code{FALSE}.} \item{resolution}{Resolution of the geospatial data. One of \itemize{ -\item "60": 1:60million -\item "20": 1:20million -\item "10": 1:10million -\item "03": 1:3million -\item "01": 1:1million +\item \code{"60"}: 1:60million +\item \code{"20"}: 1:20million +\item \code{"10"}: 1:10million +\item \code{"03"}: 1:3million +\item \code{"01"}: 1:1million }} \item{spatialtype}{Type of geometry to be returned: \itemize{ -\item \strong{"BN"}: Boundaries - \code{LINESTRING} object. -\item \strong{"COASTL"}: coastlines - \code{LINESTRING} object. -\item \strong{"INLAND"}: inland boundaries - \code{LINESTRING} object. -\item \strong{"LB"}: Labels - \code{POINT} object. -\item \strong{"RG"}: Regions - \code{MULTIPOLYGON/POLYGON} object. -}} +\item \code{"BN"}: Boundaries - \code{LINESTRING} object. +\item \code{"COASTL"}: coastlines - \code{LINESTRING} object. +\item \code{"INLAND"}: inland boundaries - \code{LINESTRING} object. +\item \code{"LB"}: Labels - \code{POINT} object. +\item \code{"RG"}: Regions - \code{MULTIPOLYGON/POLYGON} object. +} + +\strong{Note that} parameters \code{country} and \code{region} would be only applied +when \code{spatialtype} is \code{"BN"} or \code{"RG"}.} \item{country}{Optional. A character vector of country codes. It could be either a vector of country names, a vector of ISO3 country codes or a @@ -69,12 +72,13 @@ vector of Eurostat country codes. Mixed types (as \code{c("Turkey","US","FRA")}) would not work. See also \code{\link[countrycode:countrycode]{countrycode::countrycode()}}.} \item{region}{Optional. A character vector of UN M49 region codes or -European Union membership. Possible values are "Africa", "Americas", -"Asia", "Europe", "Oceania" or "EU" for countries belonging to the European -Union (as per 2021). See \strong{About world regions} and \link{gisco_countrycode}} +European Union membership. Possible values are \code{"Africa"}, \code{"Americas"}, +\code{"Asia"}, \code{"Europe"}, \code{"Oceania"} or \code{"EU"} for countries belonging to the +European Union (as per 2021). See \strong{About world regions} and +\link{gisco_countrycode}.} } \value{ -A \code{sf} object specified by \code{spatialtype}. +A \CRANpkg{sf} object specified by \code{spatialtype}. } \description{ Returns world country polygons, lines and points at a specified scale, as diff --git a/man/gisco_get_airports.Rd b/man/gisco_get_airports.Rd index 697580d8..560d9cea 100644 --- a/man/gisco_get_airports.Rd +++ b/man/gisco_get_airports.Rd @@ -25,7 +25,7 @@ gisco_get_ports( ) } \arguments{ -\item{year}{Year of reference. Only year available right now is "2013".} +\item{year}{Year of reference. Only year available right now is \code{"2013"}.} \item{country}{Optional. A character vector of country codes. It could be either a vector of country names, a vector of ISO3 country codes or a @@ -45,7 +45,7 @@ default is \code{FALSE}.} A \code{POINT} object on EPSG:4326. } \description{ -Loads a \code{sf} object from GISCO API or your local library. +Loads a \CRANpkg{sf} object from GISCO API or your local library. } \details{ \code{\link[=gisco_get_airports]{gisco_get_airports()}} refer to Europe. All shapefiles provided in diff --git a/man/gisco_get_coastallines.Rd b/man/gisco_get_coastallines.Rd index d50fd204..9629c17f 100644 --- a/man/gisco_get_coastallines.Rd +++ b/man/gisco_get_coastallines.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/gisco_get_coastallines.R \name{gisco_get_coastallines} \alias{gisco_get_coastallines} -\title{Get GISCO coastlines \code{sf} polygons} +\title{Get GISCO coastlines \CRANpkg{sf} polygons} \source{ \url{https://gisco-services.ec.europa.eu/distribution/v2/} } @@ -18,15 +18,15 @@ gisco_get_coastallines( ) } \arguments{ -\item{year}{Release year. One of "2006", "2010", "2013" or "2016"} +\item{year}{Release year. One of \code{"2006"}, \code{"2010"}, \code{"2013"} or \code{"2016"}.} \item{epsg}{projection of the map: 4-digit \href{https://epsg.io/}{EPSG code}. One of: \itemize{ -\item "4258": ETRS89 -\item "4326": WGS84 -\item "3035": ETRS89 / ETRS-LAEA -\item "3857": Pseudo-Mercator +\item \code{"4258"}: ETRS89 +\item \code{"4326"}: WGS84 +\item \code{"3035"}: ETRS89 / ETRS-LAEA +\item \code{"3857"}: Pseudo-Mercator }} \item{cache}{A logical whether to do caching. Default is \code{TRUE}. See @@ -43,15 +43,15 @@ default is \code{FALSE}.} \item{resolution}{Resolution of the geospatial data. One of \itemize{ -\item "60": 1:60million -\item "20": 1:20million -\item "10": 1:10million -\item "03": 1:3million -\item "01": 1:1million +\item \code{"60"}: 1:60million +\item \code{"20"}: 1:20million +\item \code{"10"}: 1:10million +\item \code{"03"}: 1:3million +\item \code{"01"}: 1:1million }} } \value{ -A \code{sf} \code{POLYGON} object. +A \CRANpkg{sf} \code{POLYGON} object. } \description{ Downloads worldwide coastlines diff --git a/man/gisco_get_grid.Rd b/man/gisco_get_grid.Rd index 7cb65ecc..7abfd98d 100644 --- a/man/gisco_get_grid.Rd +++ b/man/gisco_get_grid.Rd @@ -17,9 +17,9 @@ gisco_get_grid( } \arguments{ \item{resolution}{Resolution of the grid cells on kms. Available values are -"1", "2", "5", "10", "20", "50", "100". See Details} +\code{"1"}, \code{"2"}, \code{"5"}, \code{"10"}, \code{"20"}, \code{"50"}, \code{"100"}. See \strong{Details}.} -\item{spatialtype}{Select one of "REGION" or "POINT".} +\item{spatialtype}{Select one of \code{"REGION"} or \code{"POINT"}.} \item{cache_dir}{A path to a cache directory. See \strong{About caching}.} @@ -31,7 +31,7 @@ When set to \code{TRUE} it would force a fresh download of the source default is \code{FALSE}.} } \value{ -A \code{POLYGON/POINT} object. +A \code{POLYGON/POINT} \CRANpkg{sf} object. } \description{ These datasets contain grid cells covering the European land diff --git a/man/gisco_get_healthcare.Rd b/man/gisco_get_healthcare.Rd index e6a73d06..dc3d7774 100644 --- a/man/gisco_get_healthcare.Rd +++ b/man/gisco_get_healthcare.Rd @@ -34,7 +34,7 @@ vector of Eurostat country codes. Mixed types (as \code{c("Turkey","US","FRA")}) would not work. See also \code{\link[countrycode:countrycode]{countrycode::countrycode()}}.} } \value{ -A \code{POINT} object. +A \code{POINT} \CRANpkg{sf} object. } \description{ The dataset contains information on main healthcare services considered to diff --git a/man/gisco_get_lau.Rd b/man/gisco_get_lau.Rd index deb206a4..ef56a87d 100644 --- a/man/gisco_get_lau.Rd +++ b/man/gisco_get_lau.Rd @@ -3,7 +3,7 @@ \name{gisco_get_lau} \alias{gisco_get_lau} \alias{gisco_get_communes} -\title{Get GISCO urban areas \code{sf} polygons, points and lines} +\title{Get GISCO urban areas \CRANpkg{sf} polygons, points and lines} \usage{ gisco_get_communes( year = "2016", @@ -28,15 +28,15 @@ gisco_get_lau( ) } \arguments{ -\item{year}{Release year of the file. See Details.} +\item{year}{Release year of the file. See \strong{Details}.} \item{epsg}{projection of the map: 4-digit \href{https://epsg.io/}{EPSG code}. One of: \itemize{ -\item "4258": ETRS89 -\item "4326": WGS84 -\item "3035": ETRS89 / ETRS-LAEA -\item "3857": Pseudo-Mercator +\item \code{"4258"}: ETRS89 +\item \code{"4326"}: WGS84 +\item \code{"3035"}: ETRS89 / ETRS-LAEA +\item \code{"3857"}: Pseudo-Mercator }} \item{cache}{A logical whether to do caching. Default is \code{TRUE}. See @@ -53,12 +53,15 @@ default is \code{FALSE}.} \item{spatialtype}{Type of geometry to be returned: \itemize{ -\item \strong{"BN"}: Boundaries - \code{LINESTRING} object. -\item \strong{"COASTL"}: coastlines - \code{LINESTRING} object. -\item \strong{"INLAND"}: inland boundaries - \code{LINESTRING} object. -\item \strong{"LB"}: Labels - \code{POINT} object. -\item \strong{"RG"}: Regions - \code{MULTIPOLYGON/POLYGON} object. -}} +\item \code{"BN"}: Boundaries - \code{LINESTRING} object. +\item \code{"COASTL"}: coastlines - \code{LINESTRING} object. +\item \code{"INLAND"}: inland boundaries - \code{LINESTRING} object. +\item \code{"LB"}: Labels - \code{POINT} object. +\item \code{"RG"}: Regions - \code{MULTIPOLYGON/POLYGON} object. +} + +\strong{Note that} parameters \code{country} and \code{region} would be only applied +when \code{spatialtype} is \code{"BN"} or \code{"RG"}.} \item{country}{Optional. A character vector of country codes. It could be either a vector of country names, a vector of ISO3 country codes or a @@ -68,7 +71,7 @@ would not work. See also \code{\link[countrycode:countrycode]{countrycode::count \item{gisco_id}{Optional. A character vector of GISCO_ID LAU values.} } \value{ -A \code{sf} object specified by \code{spatialtype}. In the case of +A \CRANpkg{sf} object specified by \code{spatialtype}. In the case of \code{\link[=gisco_get_lau]{gisco_get_lau()}}, a \code{POLYGON} object. } \description{ @@ -76,12 +79,12 @@ A \code{sf} object specified by \code{spatialtype}. In the case of Urban Areas, that correspond roughly with towns and cities. } \details{ -Valid years for eacg function are: +Valid years for each function are: \itemize{ -\item \strong{\code{gisco_get_communes}}: one of '2001', '2004', '2006', '2008', '2010', -'2013' or '2016'. +\item \strong{\code{gisco_get_communes}}: one of \code{"2001"}, \code{"2004"}, \code{"2006"}, \code{"2008"}, +\code{"2010"}, \code{"2013"} or \code{"2016"}. \item \strong{\code{gisco_get_lau}}: one of -'2011', '2012', '2013', '2014', '2015', '2016', '2017', '2018', '2019', '2020'. +\code{"2011"}, \code{"2012"}, \code{"2013"}, \code{"2014"}, \code{"2015"}, \code{"2016"}, \code{"2017"}, \code{"2018"}, \code{"2019"}, \code{"2020"}. } } \note{ diff --git a/man/gisco_get_nuts.Rd b/man/gisco_get_nuts.Rd index ee4e8cf3..f088e956 100644 --- a/man/gisco_get_nuts.Rd +++ b/man/gisco_get_nuts.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/gisco_get_nuts.R \name{gisco_get_nuts} \alias{gisco_get_nuts} -\title{Get GISCO NUTS \code{sf} polygons, points and lines} +\title{Get GISCO NUTS \CRANpkg{sf} polygons, points and lines} \source{ \url{https://gisco-services.ec.europa.eu/distribution/v2/} } @@ -22,16 +22,16 @@ gisco_get_nuts( ) } \arguments{ -\item{year}{Release year of the file. One of "2003", "2006, -"2010", "2013", "2016" or "2021".} +\item{year}{Release year of the file. One of \code{"2003"}, \code{"2006"}, \code{"2010"}, +\code{"2013"}, \code{"2016"} or \code{"2021"}.} \item{epsg}{projection of the map: 4-digit \href{https://epsg.io/}{EPSG code}. One of: \itemize{ -\item "4258": ETRS89 -\item "4326": WGS84 -\item "3035": ETRS89 / ETRS-LAEA -\item "3857": Pseudo-Mercator +\item \code{"4258"}: ETRS89 +\item \code{"4326"}: WGS84 +\item \code{"3035"}: ETRS89 / ETRS-LAEA +\item \code{"3857"}: Pseudo-Mercator }} \item{cache}{A logical whether to do caching. Default is \code{TRUE}. See @@ -48,19 +48,22 @@ default is \code{FALSE}.} \item{resolution}{Resolution of the geospatial data. One of \itemize{ -\item "60": 1:60million -\item "20": 1:20million -\item "10": 1:10million -\item "03": 1:3million -\item "01": 1:1million +\item \code{"60"}: 1:60million +\item \code{"20"}: 1:20million +\item \code{"10"}: 1:10million +\item \code{"03"}: 1:3million +\item \code{"01"}: 1:1million }} \item{spatialtype}{Type of geometry to be returned: \itemize{ -\item \strong{"BN"}: Boundaries - \code{LINESTRING} object. -\item \strong{"LB"}: Labels - \code{POINT} object. -\item \strong{"RG"}: Regions - \code{MULTIPOLYGON/POLYGON} object. -}} +\item \code{"BN"}: Boundaries - \code{LINESTRING} object. +\item \code{"LB"}: Labels - \code{POINT} object. +\item \code{"RG"}: Regions - \code{MULTIPOLYGON/POLYGON} object. +} + +\strong{Note that} parameters \code{country}, \code{nuts_level} and \code{nuts_id} would be only +applied when \code{spatialtype} is \code{"BN"} or \code{"RG"}.} \item{country}{Optional. A character vector of country codes. It could be either a vector of country names, a vector of ISO3 country codes or a @@ -69,15 +72,16 @@ would not work. See also \code{\link[countrycode:countrycode]{countrycode::count \item{nuts_id}{Optional. A character vector of NUTS IDs.} -\item{nuts_level}{NUTS level. One of "0", "1", "2" or "3". -See Description.} +\item{nuts_level}{NUTS level. One of \code{"0"}, \code{"1"}, \code{"2"} or \code{"3"}. +See \strong{Description}.} } \value{ -A \code{sf} object specified by \code{spatialtype}. The resulting \code{sf} object -would present an additional column \code{geo} (equal to \code{NUTS_ID}) for -improving compatibility with \CRANpkg{eurostat} package. See -\code{\link[eurostat:get_eurostat_geospatial]{eurostat::get_eurostat_geospatial()}}). See also \link{gisco_nuts} to -understand the columns and values provided. +A \CRANpkg{sf} object specified by \code{spatialtype}. The resulting +\CRANpkg{sf} object would present an additional column \code{geo} (equal to +\code{NUTS_ID}) for improving compatibility with \CRANpkg{eurostat} package. See +\code{\link[eurostat:get_eurostat_geospatial]{eurostat::get_eurostat_geospatial()}}). + +See also \link{gisco_nuts} to understand the columns and values provided. } \description{ Returns @@ -86,10 +90,10 @@ polygons, lines and points at a specified scale, as provided by GISCO. NUTS are provided at three different levels: \itemize{ -\item \strong{"0"}: Country level -\item \strong{"1"}: Groups of states/regions -\item \strong{"2"}: States/regions -\item \strong{"3"}: Counties/provinces/districts +\item \code{"0"}: Country level +\item \code{"1"}: Groups of states/regions +\item \code{"2"}: States/regions +\item \code{"3"}: Counties/provinces/districts } Note that NUTS-level definition may vary across countries. See also diff --git a/man/gisco_get_postalcodes.Rd b/man/gisco_get_postalcodes.Rd index 5e9ef2e5..edd4c8b1 100644 --- a/man/gisco_get_postalcodes.Rd +++ b/man/gisco_get_postalcodes.Rd @@ -16,7 +16,7 @@ gisco_get_postalcodes( ) } \arguments{ -\item{year}{Year of reference. Currently only "2020" is available.} +\item{year}{Year of reference. Currently only \code{"2020"} is available.} \item{country}{Optional. A character vector of country codes. It could be either a vector of country names, a vector of ISO3 country codes or a @@ -33,7 +33,7 @@ When set to \code{TRUE} it would force a fresh download of the source default is \code{FALSE}.} } \value{ -A \code{POINT} object on EPSG:4326. +A \code{POINT} \CRANpkg{sf} object on EPSG:4326. } \description{ Get postal codes points of the EU, EFTA and candidate countries. diff --git a/man/gisco_get_units.Rd b/man/gisco_get_units.Rd index 68b76d7d..1c087b05 100644 --- a/man/gisco_get_units.Rd +++ b/man/gisco_get_units.Rd @@ -22,24 +22,24 @@ gisco_get_units( ) } \arguments{ -\item{id_giscoR}{Select the \code{unit} type to be downloaded. -Accepted values are "nuts", "countries" or "urban_audit".} +\item{id_giscoR}{Select the \code{unit} type to be downloaded. Accepted values are +\code{"nuts"}, \code{"countries"} or \code{"urban_audit"}.} -\item{unit}{Unit ID to be downloaded. See Details.} +\item{unit}{Unit ID to be downloaded. See \strong{Details}.} -\item{mode}{Controls the output of the function. Possible values are "sf" -or "df". See Value and Details.} +\item{mode}{Controls the output of the function. Possible values are \code{"sf"} +or \code{"df"}. See \strong{Value} and \strong{Details}.} -\item{year}{Release year of the file. One of "2001", "2006", -"2010", "2013", "2016" or "2020".} +\item{year}{Release year of the file. One of \code{"2001"}, \code{"2006"}, +\code{"2010"}, \code{"2013"}, \code{"2016"} or \code{"2020"}.} \item{epsg}{projection of the map: 4-digit \href{https://epsg.io/}{EPSG code}. One of: \itemize{ -\item "4258": ETRS89 -\item "4326": WGS84 -\item "3035": ETRS89 / ETRS-LAEA -\item "3857": Pseudo-Mercator +\item \code{"4258"}: ETRS89 +\item \code{"4326"}: WGS84 +\item \code{"3035"}: ETRS89 / ETRS-LAEA +\item \code{"3857"}: Pseudo-Mercator }} \item{cache}{A logical whether to do caching. Default is \code{TRUE}. See @@ -56,18 +56,18 @@ default is \code{FALSE}.} \item{resolution}{Resolution of the geospatial data. One of \itemize{ -\item "60": 1:60million -\item "20": 1:20million -\item "10": 1:10million -\item "03": 1:3million -\item "01": 1:1million +\item \code{"60"}: 1:60million +\item \code{"20"}: 1:20million +\item \code{"10"}: 1:10million +\item \code{"03"}: 1:3million +\item \code{"01"}: 1:1million }} -\item{spatialtype}{Type of geometry to be returned: "RG", for \code{POLYGON} and -"LB" for \code{POINT}.} +\item{spatialtype}{Type of geometry to be returned: \code{"RG"}, for \code{POLYGON} and +\code{"LB"} for \code{POINT}.} } \value{ -A \code{sf} object on \code{mode = "sf"} or a dataframe on \code{mode = "df"}. +A \CRANpkg{sf} object on \code{mode = "sf"} or a data frame on \code{mode = "df"}. } \description{ Download individual shapefiles of units. Unlike \code{\link[=gisco_get_countries]{gisco_get_countries()}}, @@ -76,11 +76,11 @@ dataset and applies filters, \code{\link[=gisco_get_units]{gisco_get_units()}} d shapefile for each unit. } \details{ -The function can return a dataframe on \code{mode = "df"} or a \code{sf} object -on \code{mode = "sf"}. +The function can return a data frame on \code{mode = "df"} or a \CRANpkg{sf} +object on \code{mode = "sf"}. In order to see the available \code{unit} ids with the required -combination of \verb{spatialtype, year}, first run the function on "df" +combination of \verb{spatialtype, year}, first run the function on \code{"df"} mode. Once that you get the data frame you can select the required ids on the \code{unit} parameter. diff --git a/man/gisco_get_urban_audit.Rd b/man/gisco_get_urban_audit.Rd index 84466d28..c5e7c352 100644 --- a/man/gisco_get_urban_audit.Rd +++ b/man/gisco_get_urban_audit.Rd @@ -2,7 +2,8 @@ % Please edit documentation in R/gisco_get_urban_audit.R \name{gisco_get_urban_audit} \alias{gisco_get_urban_audit} -\title{Get GISCO greater cities and metropolitan areas \code{sf} polygons and points} +\title{Get GISCO greater cities and metropolitan areas \CRANpkg{sf} polygons and +points} \source{ \url{https://gisco-services.ec.europa.eu/distribution/v2/} } @@ -20,16 +21,16 @@ gisco_get_urban_audit( ) } \arguments{ -\item{year}{Release year of the file. One of "2001", "2004", -"2014", "2018" or "2020".} +\item{year}{Release year of the file. One of \code{"2001"}, \code{"2004"}, \code{"2014"}, +\code{"2018"} or \code{"2020"}.} \item{epsg}{projection of the map: 4-digit \href{https://epsg.io/}{EPSG code}. One of: \itemize{ -\item "4258": ETRS89 -\item "4326": WGS84 -\item "3035": ETRS89 / ETRS-LAEA -\item "3857": Pseudo-Mercator +\item \code{"4258"}: ETRS89 +\item \code{"4326"}: WGS84 +\item \code{"3035"}: ETRS89 / ETRS-LAEA +\item \code{"3857"}: Pseudo-Mercator }} \item{cache}{A logical whether to do caching. Default is \code{TRUE}. See @@ -46,8 +47,8 @@ default is \code{FALSE}.} \item{spatialtype}{Type of geometry to be returned: \itemize{ -\item \strong{"LB"}: Labels - \code{POINT} object. -\item \strong{"RG"}: Regions - \code{MULTIPOLYGON/POLYGON} object. +\item \code{"LB"}: Labels - \code{POINT} object. +\item \code{"RG"}: Regions - \code{MULTIPOLYGON/POLYGON} object. }} \item{country}{Optional. A character vector of country codes. It could be @@ -55,11 +56,11 @@ either a vector of country names, a vector of ISO3 country codes or a vector of Eurostat country codes. Mixed types (as \code{c("Turkey","US","FRA")}) would not work. See also \code{\link[countrycode:countrycode]{countrycode::countrycode()}}.} -\item{level}{Level of Urban Audit. Possible values are "CITIES", "FUA", -"GREATER_CITIES" or \code{NULL}, that would download the full dataset.} +\item{level}{Level of Urban Audit. Possible values are \code{"CITIES"}, \code{"FUA"}, +\code{"GREATER_CITIES"} or \code{NULL}, that would download the full dataset.} } \value{ -A \code{sf} object specified by \code{spatialtype}. +A \CRANpkg{sf} object specified by \code{spatialtype}. } \description{ Returns polygons and points corresponding to cities, greater cities and diff --git a/man/gisco_nuts.Rd b/man/gisco_nuts.Rd index 2d390237..ca112b56 100644 --- a/man/gisco_nuts.Rd +++ b/man/gisco_nuts.Rd @@ -29,7 +29,8 @@ A \code{POLYGON} data frame (resolution: 1:20million, EPSG:4326) object with file. } \description{ -A \code{sf} object including all NUTS levels as provided by GISCO (2016 version). +A \CRANpkg{sf} object including all NUTS levels as provided by GISCO +(2016 version). } \details{ \strong{MOUNT_TYPE}: Mountain typology: diff --git a/man/gisco_set_cache_dir.Rd b/man/gisco_set_cache_dir.Rd index f1393eee..e105175c 100644 --- a/man/gisco_set_cache_dir.Rd +++ b/man/gisco_set_cache_dir.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/gisco_cache.R \name{gisco_set_cache_dir} \alias{gisco_set_cache_dir} -\title{Set your \strong{giscoR} cache dir} +\title{Set your \CRANpkg{giscoR} cache dir} \usage{ gisco_set_cache_dir( cache_dir,