Parses various region input formats into a standardized structure for use in other package functions.
Value
A list with components:
type: One of "l3_code", "vector", or "bbox"value: The parsed region object (character code, sf object, or st_bbox)
Examples
# Parse a bounding box (xmin, ymin, xmax, ymax)
region_info <- wapor_parse_region(c(35.0, 33.0, 36.0, 34.0))
region_info$type
#> [1] "bbox"
# [1] "bbox"
# Parse an L3 region code
region_info <- wapor_parse_region("AWA")
region_info$type
#> [1] "l3_code"
# [1] "l3_code"
if (FALSE) { # \dontrun{
# Parse a shapefile
region_info <- wapor_parse_region("path/to/region.shp")
region_info$type
# [1] "vector"
} # }