existsCtryNlDataFile: Check if a country admin level data file exists

Description Usage Arguments Value Examples

View source: R/ctrynldata.R

Description

Check if a country admin level data file exists. Stats are calculated and stored at the admin level of a country, hence, a country could have as many files as admin levels.

Usage

1
2
3
4
5
6
7
existsCtryNlDataFile(
  ctryCode = NULL,
  admLevel,
  gadmVersion = pkgOptions("gadmVersion"),
  gadmPolyType = pkgOptions("gadmPolyType"),
  custPolyPath = NULL
)

Arguments

ctryCode

the ISO3 country code

admLevel

The country admin level of interest.

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

TRUE/FALSE

Examples

1
2
3
4
5
ctryCode <- "KEN"
admLevel <- "KEN_adm0"
message(Sys.time(), ": Data file for ", ctryCode,
    ifelse(Rnightlights:::existsCtryNlDataFile(ctryCode, admLevel),
        " FOUND", " NOT FOUND"))

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