50% off | Unlimited Data & AI Learning
Get 50% off unlimited learning

subincomeR (version 0.2.2)

getDOSE_geom: Download and load GADM-DOSE geometries

Description

This function downloads and loads GADM-DOSE geometries from a remote source. The geometries are stored in a temporary directory by default, or in a user-specified location if provided. The uncompressed geometries file is approximately 769 MB.

Usage

getDOSE_geom(path = NULL, countries = NULL, download = FALSE)

Value

An sf object containing the GADM-DOSE geometries

Arguments

path

Optional character string specifying where to store the files. If NULL (default), uses tempdir().

countries

Optional vector of ISO3C country codes to filter geometries. If NULL (default), all available geometries are returned.

download

Logical indicating whether to download without confirmation. Default is FALSE, which will prompt for confirmation in interactive sessions. Set to TRUE to skip confirmation.

Examples

Run this code
# \donttest{
# Load all geometries with download confirmation
geom_all <- getDOSE_geom()

# Load geometries with automatic download
geom_auto <- getDOSE_geom(download = TRUE)

# Load geometries for specific countries
geom_subset <- getDOSE_geom(
  countries = c("USA", "CAN", "MEX"),
  download = TRUE
)
# }

Run the code above in your browser using DataLab