View source: R/gisco-get-countries.R
| gisco_get_countries | R Documentation |
This dataset contains the administrative boundaries at country level of the world. This dataset consists of 2 feature classes (regions, boundaries) per scale level and there are 5 different scale levels (1M, 3M, 10M, 20M and 60M).
Please note that this function gets data from the aggregated GISCO
country file. If you prefer to download individual country files, please 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 |
character string or number. Release year of the file. One of \Sexpr[stage=render,results=rd]{giscoR:::db_values("countries", "year",TRUE)}. |
epsg |
character string or number. Projection of the map: 4-digit EPSG code. One of:
|
cache |
logical. Whether to do caching. Default is |
update_cache |
logical. Should the cached file be refreshed?. Default
is |
cache_dir |
character string. A path to a cache directory. See
Caching strategies section in |
verbose |
logical. If |
resolution |
character string or number. Resolution of the geospatial data. One of:
|
spatialtype |
character string. Type of geometry to be returned. Options available are:
Note that arguments |
country |
character vector of country codes. It could be either a
vector of country names, a vector of ISO3 country codes or a vector of
Eurostat country codes. See also |
region |
Optional. A character vector of UN M49 region codes or
European Union membership. Possible values are |
ext |
character. Extension of the file (default |
A sf object.
Regions are defined as per the geographic regions defined by the UN (see https://unstats.un.org/unsd/methodology/m49/. Under this scheme Cyprus is assigned to Asia.
Please check the download and usage provisions on 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 files.
See gisco_id_api_country() to download via GISCO ID service API.
Other administrative units 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.