readCtryPolyAdmLayer: Read a country admLevel polygon
Description
Read a country admLevel polygon. Reads the saved RDS format of the shapefile
which is saved as part of dnldCtryPoly by default. Otherwise,
it will try to read the shapefile. If it fails it returns null.
Usage
readCtryPolyAdmLayer(ctryCode = NULL, admLevel, polyType = "rds",
dnldPoly = TRUE, gadmVersion = pkgOptions("gadmVersion"),
custPolyPath = NULL)Arguments
ctryCode
character The ctryCode of the country of interest
admLevel
character The name to search for
polyType
character Whether to read the shapefile or the RDS
format.
dnldPoly
logical If the country polygon doesn't exist
should we download it?
custPolyPath
Alternative to GADM. A path to a custom shapefile zip
Value
SpatialPolygonsDataFrame The admLevel polygon layer or NULL
if not found
Examples
Run this code# NOT RUN {
readCtryPolyAdmLayer("KEN", "KEN_adm1")
#returns "KEN_adm1"
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab