Get neighbors of a given contry
Arguments
- src
Source spatial data frame
- countries
countries of interest
- var
Variable name
- crs
Coordinates reference system, default is WGS84 (EPGS:4326)
- crop
Crop sfc to focus countries extent?
Examples
if (FALSE) {
library(gisr)
cntry <- "Zambia"
shp_ne <- get_necountries()
# Country + neighbors boundaries
cntries <- geo_neighbors(src = shp_ne, countries = cntry)
# Country + neighbors boundaries: crop to country extent
cntries <- geo_neighbors(src = shp_ne, countries = cntry, crop = TRUE)
cntries %>% gview()
}