Retrieve the shapefile for a country at the given level. GADM identifies countries with the Alpha-3 country code. If the file doesn't exist, it will return a NULL.

gadm_country_shapefile(alpha3, admin_level = 0, gadm_version = "201104")

Arguments

alpha3

The three-letter country code.

admin_level

0 is the whole country. Different countries have more or fewer levels.

gadm_version

When this version of GADM was downloaded.

Value

A shapefile from the sf package, read with st_read.

This function depends on having a working tempfile() command because it has to unzip the shapefile into a temporary directory.