readCtryPolyAdmLayer: Read a country admLevel polygon

Description Usage Arguments Value Examples

View source: R/polygons.R

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

1
2
3
readCtryPolyAdmLayer(ctryCode = NULL, admLevel, polyType = "rds",
  dnldPoly = TRUE, gadmVersion = pkgOptions("gadmVersion"),
  gadmPolyType = pkgOptions("gadmPolyType"), 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?

gadmVersion

The GADM version to use

gadmPolyType

The format of polygons to download from GADM

custPolyPath

Alternative to GADM. A path to a custom shapefile zip

Value

SpatialPolygonsDataFrame The admLevel polygon layer or NULL if not found

Examples

1
2
3
4
5
## Not run: 
readCtryPolyAdmLayer("KEN", "KEN_adm1")
#returns "KEN_adm1"

## End(Not run)

Rnightlights documentation built on Aug. 29, 2019, 5:02 p.m.