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
4
5
6
7
8
9
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)

chrisvwn/Rnightlights documentation built on Sept. 7, 2021, 1:44 a.m.