Skip to contents

This data set 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).

Usage

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"
)

Arguments

year

character string or number. Release year of the file. One of "2024", "2020", "2016", "2013", "2010", "2006", "2001" .

epsg

character string or number. Projection of the map: 4-digit EPSG code. One of:

cache

logical. Whether to do caching. Default is TRUE. See Caching strategies section in gisco_set_cache_dir().

update_cache

logical. Should the cached file be refreshed?. Default is FALSE. When set to TRUE it would force a new download.

cache_dir

character string. A path to a cache directory. See Caching strategies section in gisco_set_cache_dir().

verbose

logical. If TRUE displays informational messages.

resolution

character string or number. Resolution of the geospatial data. One of:

  • "60": 1:60million

  • "20": 1:20million

  • "10": 1:10million

  • "03": 1:3million

  • "01": 1:1million

spatialtype

character string. Type of geometry to be returned. Options available are:

  • "BN": Boundaries - LINESTRING object.

  • "COASTL": coastlines - LINESTRING object.

  • "INLAND": inland boundaries - LINESTRING object.

  • "LB": Labels - POINT object.

  • "RG": Regions - MULTIPOLYGON/POLYGON object.

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 vector of Eurostat country codes. See also countrycode::countrycode().

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 World regions and gisco_countrycode.

ext

character. Extension of the file (default "gpkg"). One of "shp", "gpkg", "geojson" .

Value

A sf object.

World Regions

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.

Examples

# \donttest{
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()

# }