Find coordinates and uncertainty for administrative areas

adm_pointRadius(country, adm, cache_path=NULL, method="high_probability", geo=NULL)

Arguments

country

country name or country ISO code, or a SpatVector of polygons

adm

positive integer to indicated admin level

cache_path

path to pass the geodata::gadm to cache the gadm data. Use NULL to set a default path

method

character. "high_probability" or "low_uncertainty"

geo

data.frame to compute the uncertainty based on pre-defined coordinates instead of adminstrative area centroids. The data.frame must have variables "longitude", "latitude" and "adm_" (replace underscore to match argument adm) with names that match the GADM admistrative area names. The locations should be inside the polygons with the matching names

Value

data.frame

Examples

v <- terra::vect(system.file("ex/lux.shp", package="terra"))[, c("NAME_1", "NAME_2")]
a <- adm_pointRadius(v, method="high_probability")
#> Error in adm_pointRadius(v, method = "high_probability"): packageVersion("terra") >= "1.9.37" is not TRUE
dfput(a[1:3, ])
#> Error: object 'a' not found