Learn R Programming

Rnightlights (version 0.2.3)

existsCtryNlDataFile: Check if a country admin level data file exists

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

existsCtryNlDataFile(ctryCode = NULL, admLevel,
  gadmVersion = pkgOptions("gadmVersion"), custPolyPath = NULL)

Arguments

ctryCode

the ISO3 country code

admLevel

The country admin level of interest.

gadmVersion

The GADM version to use

custPolyPath

Alternative to GADM. A path to a custom shapefile zip

Value

TRUE/FALSE

Examples

Run this code
# NOT RUN {
ctryCode <- "KEN"
admLevel <- "KEN_adm0"
message(Sys.time(), ": Data file for ", ctryCode, 
    ifelse(Rnightlights:::existsCtryNlDataFile(ctryCode, admLevel), 
        " FOUND", " NOT FOUND"))

# }

Run the code above in your browser using DataLab