View source: R/gisco-get-countries.R
| gisco_get_countries | R Documentation |
This dataset contains world administrative boundaries at the country level. It provides two feature classes, regions and boundaries, at five scale levels: 1M, 3M, 10M, 20M and 60M.
Downloads data from the aggregated GISCO country file. To download
single-unit country files, use gisco_get_unit_country().
gisco_get_countries(
year = 2024,
epsg = 4326,
cache = TRUE,
update_cache = FALSE,
cache_dir = NULL,
verbose = FALSE,
resolution = 20,
spatialtype = "RG",
country = NULL,
region = NULL,
ext = "gpkg"
)
year |
A character string or numeric value with the release year of the file. One of \Sexpr[stage=render,results=rd]{giscoR:::db_values("countries", "year",TRUE)}. |
epsg |
A character string or numeric value with the coordinate reference system as a 4-digit EPSG code. One of:
|
cache |
A logical value indicating whether to cache results. Defaults
to |
update_cache |
A logical value indicating whether to refresh the
cached file. Defaults to |
cache_dir |
A character string with a path to a cache directory. See
Caching strategies section in |
verbose |
A logical value. If |
resolution |
A character string or numeric value with the geospatial data resolution. One of:
|
spatialtype |
A character string with the type of geometry to return. Options available are:
|
country |
A character vector of country codes. It can be either a
vector of country names, a vector of ISO 3166-1 alpha-3 country codes or a
vector of Eurostat country codes. See also |
region |
An optional character vector of UN M49 region codes or
European Union membership. Possible values are |
ext |
A character value with the extension of the file (default
|
A sf object.
Regions follow the UN geographic regions (see https://unstats.un.org/unsd/methodology/m49/). Under this scheme Cyprus is assigned to Asia.
Check the download and usage provisions in gisco_attributions().
https://gisco-services.ec.europa.eu/distribution/v2/.
Copyright: https://ec.europa.eu/eurostat/web/gisco/geodata/administrative-units.
gisco_countrycode, gisco_countries_2024, gisco_get_metadata(),
countrycode::countrycode().
See gisco_bulk_download() to perform a bulk download of datasets.
See gisco_get_unit_country() to download single-unit files.
See gisco_id_api_country() to download via GISCO ID service API.
Administrative unit datasets:
gisco_get_communes(),
gisco_get_postal_codes()
cntries <- gisco_get_countries()
library(ggplot2)
ggplot(cntries) +
geom_sf()
# Get a region
africa <- gisco_get_countries(region = "Africa")
ggplot(africa) +
geom_sf(fill = "#078930", col = "white") +
theme_minimal()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.