Learn R Programming

Rnightlights (version 0.1.2)

getCtryNlDataColName: Construct the name of a nightlight data column given the nightlight type and nlPeriod

Description

Construct the name of a nightlight data column given the nightlight type and nlPeriod Used in creating and retrieving data columns from the nightlight data file

Usage

getCtryNlDataColName(nlPeriod, stat, nlType)

Arguments

nlPeriod

character vector The nlPeriod to process

stat

character vector The stat to be stored in the column

nlType

character vector The type of nightlight i.e. "OLS" or VIIRS. Default=VIIRS

Value

character string

Examples

Run this code
# NOT RUN {
ctryCode <- "KEN"
dt <- read.csv(getCtryNlDataFnamePath(ctryCode))
dt <- dt[,getCtryNlDataColName("201612", "sum", nlType="VIIRS")]
  #returns the column "NL_201612_SUM" if it exists in the KEN data file
  
# }

Run the code above in your browser using DataLab