Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dieghernan committed Mar 26, 2024
1 parent f7d0478 commit fb374f3
Show file tree
Hide file tree
Showing 53 changed files with 345 additions and 247 deletions.
94 changes: 50 additions & 44 deletions R/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,28 @@
#' data(gisco_db)
NULL

#' World countries `POLYGON` \CRANpkg{sf} object
#' World countries `POLYGON` [`sf`][sf::st_sf] object
#'
#' @family dataset
#'
#' @name gisco_countries
#'
#' @description A \CRANpkg{sf} object including all countries as provided by
#' @description
#' A [`sf`][sf::st_sf] object including all countries as provided by
#' GISCO (2016 version).
#'
#' @format
#' A `MULTIPOLYGON` data frame (resolution: 1:20million, EPSG:4326) object
#' with `r nrow(giscoR::gisco_countries)` rows and 7 variables:
#' \describe{
#' \item{id}{row ID}
#' \item{CNTR_NAME}{Official country name on local language}
#' \item{id}{row ID.}
#' \item{CNTR_NAME}{Official country name on local language.}
#' \item{ISO3_CODE}{ISO 3166-1 alpha-3 code of each country, as provided by
#' GISCO}
#' \item{CNTR_ID}{Country ID}
#' \item{NAME_ENGL}{Country name in English}
#' \item{FID}{FID}
#' \item{geometry}{geometry field}
#' GISCO.}
#' \item{CNTR_ID}{Country ID.}
#' \item{NAME_ENGL}{Country name in English.}
#' \item{FID}{FID.}
#' \item{geometry}{geometry field.}
#' }
#' @examples
#'
Expand Down Expand Up @@ -71,19 +72,21 @@ NULL

#' World coastal lines `POLYGON` object
#'
#' A \CRANpkg{sf} object as provided by GISCO (2016 version).
#' @description
#'
#' A [`sf`][sf::st_sf] object as provided by GISCO (2016 version).
#'
#' @family dataset
#'
#' @name gisco_coastallines
#'
#' @format
#' A `POLYGON` \CRANpkg{sf} object (resolution: 1:20million, EPSG:4326) with
#' 3 variables:
#' A `POLYGON` [`sf`][sf::st_sf] object (resolution: 1:20million, EPSG:4326)
#' with 3 variables:
#' \describe{
#' \item{COAS_ID}{Coast ID}
#' \item{FID}{FID}
#' \item{geometry}{geometry field}
#' \item{COAS_ID}{Coast ID.}
#' \item{FID}{FID.}
#' \item{geometry}{geometry field.}
#' }
#'
#' @source
Expand Down Expand Up @@ -126,7 +129,7 @@ NULL

#' All NUTS `POLYGON` object
#'
#' A \CRANpkg{sf} object including all NUTS levels as provided by GISCO
#' A [`sf`][sf::st_sf] object including all NUTS levels as provided by GISCO
#' (2016 version).
#'
#' @family dataset
Expand All @@ -138,44 +141,45 @@ NULL
#' `r prettyNum(nrow(giscoR::gisco_nuts), big.mark = ",")` rows and
#' 11 variables:
#' \describe{
#' \item{NUTS_ID}{NUTS identifier}
#' \item{LEVL_CODE}{NUTS level code (0,1,2,3)}
#' \item{URBN_TYPE}{Urban Type, see Details}
#' \item{CNTR_CODE}{Eurostat Country code}
#' \item{NAME_LATN}{NUTS name on Latin characters}
#' \item{NUTS_NAME}{NUTS name on local alphabet}
#' \item{MOUNT_TYPE}{Mount Type, see Details}
#' \item{COAST_TYPE}{Coast Type, see Details}
#' \item{FID}{FID}
#' \item{NUTS_ID}{NUTS identifier.}
#' \item{LEVL_CODE}{NUTS level code `(0,1,2,3)`.}
#' \item{URBN_TYPE}{Urban Type, see **Details**.}
#' \item{CNTR_CODE}{Eurostat Country code.}
#' \item{NAME_LATN}{NUTS name on Latin characters.}
#' \item{NUTS_NAME}{NUTS name on local alphabet.}
#' \item{MOUNT_TYPE}{Mount Type, see **Details**.}
#' \item{COAST_TYPE}{Coast Type, see **Details**.}
#' \item{FID}{FID.}
#' \item{geo}{Same as NUTS_ID, provided for compatibility with
#' \CRANpkg{eurostat}}
#' \item{geometry}{geometry field}
#' \CRANpkg{eurostat}.}
#' \item{geometry}{geometry field.}
#' }
#'
#' @details
#'
#' **MOUNT_TYPE**: Mountain typology:
#' - 1: More than 50 % of the surface is covered by topographic mountain areas.
#' - 2: More than 50 % of the regional population lives in topographic
#' - `1`: More than 50 % of the surface is covered by topographic mountain
#' areas.
#' - `2`: More than 50 % of the regional population lives in topographic
#' mountain areas.
#' - 3: More than 50 % of the surface is covered by topographic mountain areas
#' and where more than 50 % of the regional population lives in these
#' - `3`: More than 50 % of the surface is covered by topographic mountain
#' areas and where more than 50 % of the regional population lives in these
#' mountain areas.
#' - 4: Non-mountain region / other regions.
#' - 0: No classification provided
#' - `4`: Non-mountain region / other regions.
#' - `0`: No classification provided.
#'
#' **URBN_TYPE**: Urban-rural typology:
#' - 1: Predominantly urban region.
#' - 2: Intermediate region.
#' - 3: Predominantly rural region.
#' - 0: No classification provided
#' - `1`: Predominantly urban region.
#' - `2`: Intermediate region.
#' - `3`: Predominantly rural region.
#' - `0`: No classification provided.
#'
#' **COAST_TYPE**: Coastal typology:
#' - 1: Coastal (on coast).
#' - 2: Coastal (less than 50% of population living within 50 km. of the
#' - `1`: Coastal (on coast).
#' - `2`: Coastal (less than 50% of population living within 50 km. of the
#' coastline).
#' - 3: Non-coastal region.
#' - 0: No classification provided
#' - `3`: Non-coastal region.
#' - `0`: No classification provided.
#'
#'
#' @source
Expand Down Expand Up @@ -234,16 +238,18 @@ NULL
#' \item{un.regionintermediate.name}{Intermediate Region name UN (M49).}
#' \item{un.regionsub.code}{Numeric sub-region code UN (M49).}
#' \item{un.regionsub.name}{Sub-Region name UN (M49).}
#' \item{eu}{Logical indicating if the country belongs to the European.}
#' \item{eu}{Logical indicating if the country belongs to the European Union.}
#' }
#'
#' @examples
#'
#' data(gisco_countrycode)
#'
#' @source [countrycode::codelist] **v1.2.0**.
#'
#' @seealso [gisco_get_countries()],
#' [countrycode::codelist], \CRANpkg{countrycode} package.
#' @seealso
#' [gisco_get_countries()] and [countrycode::codelist], included in
#' \CRANpkg{countrycode}.
#'
#' See also the
#' ```{r, echo=FALSE, results='asis'}
Expand Down
32 changes: 17 additions & 15 deletions R/gisco_attributions.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,30 @@
#'
#' @description
#' Get the legal text to be used along with the data downloaded with this
#' package
#' package.
#'
#' @export
#'
#' @param lang Language (two-letter ISO code). See
#' <https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes> and Details.
#' <https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes> and **Details**.
#'
#' @param copyright
#' Boolean. Whether to display the copyright notice or not on the console.
#' @param copyright Boolean `TRUE/FALSE`. Whether to display the copyright
#' notice or not on the console.
#'
#' @return A string with the attribution to be used.
#'
#' @encoding UTF-8
#'
#' @details
#' Current languages supported are:
#' * `"en"` - English
#' * `"da"` - Danish
#' * `"de"` - German
#' * `"es"` - Spanish
#' * `"fi"` - Finish
#' * `"fr"` - French
#' * `"no"` - Norwegian
#' * `"sv"` - Swedish
#' * `"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
Expand All @@ -41,9 +43,9 @@
#' 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
#' * 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
Expand Down
25 changes: 12 additions & 13 deletions R/gisco_bulk_download.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
#' @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
#'
Expand All @@ -32,13 +32,12 @@
#' @details
#'
#' See the years available in the corresponding functions:
#' * [gisco_get_coastallines()]
#' * [gisco_get_communes()]
#' * [gisco_get_countries()]
#' * [gisco_get_lau()]
#' * [gisco_get_nuts()]
#' * [gisco_get_urban_audit()]
#'
#' * [gisco_get_coastallines()].
#' * [gisco_get_communes()].
#' * [gisco_get_countries()].
#' * [gisco_get_lau()].
#' * [gisco_get_nuts()].
#' * [gisco_get_urban_audit()].
#'
#' The usual extension used across \CRANpkg{giscoR} is `"geojson"`,
#' however other formats are already available on GISCO.
Expand Down
3 changes: 2 additions & 1 deletion R/gisco_cache.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
#' run this command on each session (Similar to `install = FALSE`).
#' * Write this line on your `.Renviron` file:
#' `GISCO_CACHE_DIR = "value_for_cache_dir"` (same behavior than
#' `install = TRUE`). This would store your `cache_dir` permanently.
#' `install = TRUE`). This would store your `cache_dir` permanently. See
#' also `usethis::edit_r_environ()`.
#'
#' @inheritParams gisco_get_nuts
#' @param cache_dir A path to a cache directory. On missing value the function
Expand Down
2 changes: 1 addition & 1 deletion R/gisco_get_airports.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' Get location of airports and ports from GISCO API
#'
#' Loads a \CRANpkg{sf} object from GISCO API or your local library.
#' Loads a [`sf`][sf::st_sf] object from GISCO API or your local library.
#'
#' @family infrastructure
#'
Expand Down
4 changes: 2 additions & 2 deletions R/gisco_get_coastallines.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' Get GISCO coastlines \CRANpkg{sf} polygons
#' Get GISCO coastlines [`sf`][sf::st_sf] polygons
#'
#' Downloads worldwide coastlines
#'
Expand All @@ -12,7 +12,7 @@
#'
#' @source <https://gisco-services.ec.europa.eu/distribution/v2/>
#'
#' @return A \CRANpkg{sf} `POLYGON` object.
#' @return A [`sf`][sf::st_sf] `POLYGON` object.
#'
#' @note
#' Please check the download and usage provisions on [gisco_attributions()].
Expand Down
4 changes: 2 additions & 2 deletions R/gisco_get_countries.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' Get GISCO world country \CRANpkg{sf} polygons, points and lines
#' Get GISCO world country [`sf`][sf::st_sf] polygons, points and lines
#'
#' @description
#' Returns world country polygons, lines and points at a specified scale, as
Expand Down Expand Up @@ -38,7 +38,7 @@
#' `region = "EU"` to get the EU members (reference date: 2021).
#'
#'
#' @return A \CRANpkg{sf} object specified by `spatialtype`.
#' @return A [`sf`][sf::st_sf] object specified by `spatialtype`.
#'
#' @param year Release year of the file. One
#' of `r gsc_helper_year_docs("countries")`.
Expand Down
2 changes: 1 addition & 1 deletion R/gisco_get_grid.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#'
#' @family misc
#'
#' @return A `POLYGON/POINT` \CRANpkg{sf} object.
#' @return A `POLYGON/POINT` [`sf`][sf::st_sf] object.
#'
#' @author dieghernan, <https://github.com/dieghernan/>
#'
Expand Down
2 changes: 1 addition & 1 deletion R/gisco_get_healthcare.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#' The dataset contains information on main healthcare services considered to
#' be 'hospitals' by Member States.
#'
#' @return A `POINT` \CRANpkg{sf} object.
#' @return A `POINT` [`sf`][sf::st_sf] object.
#'
#' @author dieghernan, <https://github.com/dieghernan/>
#'
Expand Down
4 changes: 2 additions & 2 deletions R/gisco_get_lau.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' Get GISCO urban areas \CRANpkg{sf} polygons, points and lines
#' Get GISCO urban areas [`sf`][sf::st_sf] polygons, points and lines
#'
#' @description
#' [gisco_get_communes()] and [gisco_get_lau()] download shapes of Local
Expand All @@ -10,7 +10,7 @@
#' Please check the download and usage provisions on [gisco_attributions()].
#' @family political
#'
#' @return A \CRANpkg{sf} object specified by `spatialtype`. In the case of
#' @return A [`sf`][sf::st_sf] object specified by `spatialtype`. In the case of
#' [gisco_get_lau()], a `POLYGON` object.
#'
#' @param year Release year of the file:
Expand Down
6 changes: 3 additions & 3 deletions R/gisco_get_nuts.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' Get GISCO NUTS \CRANpkg{sf} polygons, points and lines
#' Get GISCO NUTS [`sf`][sf::st_sf] polygons, points and lines
#'
#' @description
#' Returns
Expand Down Expand Up @@ -30,8 +30,8 @@
#'
#' @family political
#'
#' @return A \CRANpkg{sf} object specified by `spatialtype`. The resulting
#' \CRANpkg{sf} object would present an additional column `geo` (equal to
#' @return A [`sf`][sf::st_sf] object specified by `spatialtype`. The resulting
#' [`sf`][sf::st_sf] object would present an additional column `geo` (equal to
#' `NUTS_ID`) for improving compatibility with \CRANpkg{eurostat} package. See
#' [eurostat::get_eurostat_geospatial()]).
#'
Expand Down
2 changes: 1 addition & 1 deletion R/gisco_get_postalcodes.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#'
#' @family political
#'
#' @return A `POINT` \CRANpkg{sf} object on EPSG:4326.
#' @return A `POINT` [`sf`][sf::st_sf] object on EPSG:4326.
#'
#' @export
#'
Expand Down
4 changes: 2 additions & 2 deletions R/gisco_get_units.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#' @family political
#'
#' @return
#' A \CRANpkg{sf} object on `mode = "sf"` or a data frame on `mode = "df"`.
#' A [`sf`][sf::st_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"`.
Expand All @@ -27,7 +27,7 @@
#' @inheritSection gisco_get_countries About caching
#'
#' @details
#' The function can return a data frame on `mode = "df"` or a \CRANpkg{sf}
#' The function can return a data frame on `mode = "df"` or a [`sf`][sf::st_sf]
#' object on `mode = "sf"`.
#'
#' In order to see the available `unit` ids with the required
Expand Down
Loading

0 comments on commit fb374f3

Please sign in to comment.