download_shapefile | R Documentation |
This function ensures the specified shapefile ('dest_file') contains boundaries for all requested ISO3 codes ('country_codes'). It dynamically Downloades only the missing codes and appends them to the file, ensuring no duplication.
download_shapefile(
country_codes,
dest_file = here::here("01_data", "1c_shapefiles", "district_shape.gpkg")
)
country_codes |
Character vector of ISO3 country codes (e.g. c("KEN","UGA")). |
dest_file |
File path where data is saved (default: "01_data/1c_shapefiles/district_shape.gpkg"). |
An 'sf' object of combined boundaries for all requested country codes.
tf <- file.path(tempdir(), "test_env")
# Download population rasters from worldpop
download_shapefile(
country_codes = "COM",
dest_file = here::here(tf, "district_shape.gpkg")
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.