
Get Mean or Median Elevation from Downloaded DEM Data Using Country Boundaries
Source:R/get_elevation.R
get_elevation.RdThis function calculates the mean or median elevation for a given set of ISO3 country codes by loading the downloaded DEM files and extracting raster values within the country's boundary.
Arguments
- PATHS
A list containing paths where DEM data is stored. Typically generated by the
get_paths()function and should include:DATA_DEM: Path to the directory where DEM rasters are saved (GeoTIFF format).
DATA_SHAPEFILES: Path to the directory where shapefiles are saved.
- iso_codes
A character vector of ISO3 country codes for which the elevation data will be calculated.
- method
A character string specifying the method to use for calculating elevation statistics. Can be
"mean"or"median"(default is"median").