Learn R Programming

Rnightlights (version 0.2.3)

getCtryShpLyrNames: Get the standard names of polygon layers in a country

Description

Get the standard name of a polygon layer for a country. Used to refer to a polygon layer by name i.e. for CTRYCODE & lyrNum="0": lyrName="CTRYCODE_adm0", lyrNum="1": lyrName="KEN_adm1". Note this is different from the official country administration level name.

Usage

getCtryShpLyrNames(ctryCodes = NULL, lyrNums, dnldPoly,
  gadmVersion = pkgOptions("gadmVersion"), custPolyPath = NULL)

Arguments

ctryCodes

the ISO3 codes for the countries

lyrNums

the layer numbers starting from 0 = country level, 1 = first admin level

dnldPoly

logical If the country polygon doesn't exist should we download it?

gadmVersion

The GADM version to use

custPolyPath

Alternative to GADM. A path to a custom shapefile zip

Value

Character layer name

Examples

Run this code
# NOT RUN {
#requires KEN polygon shapefile to exist in the polygons folder
getCtryShpLyrNames("KEN","1")
  #returns "KEN_adm1"
# }
# NOT RUN {
#export only due to exploreData() shiny app
# }

Run the code above in your browser using DataLab