Learn R Programming

Rnightlights (version 0.1.5)

insertNlDataCol: Insert an aggregate nightlight data column in a country nightlights dataframe

Description

Insert an aggregate nightlight data column in a country nightlights dataframe. The number of elements in the vector MUST match the number of rows in the country dataframe.

Usage

insertNlDataCol(ctryNlDataDF, dataCol, statType, nlPeriod, nlType)

Arguments

ctryNlDataDF

dataframe with the country data to save

dataCol

the numeric vector to be inserted as a column

statType

the stat which produced the dataCol vector

nlPeriod

the nlPeriod that the dataCol belongs to

nlType

the type of nightlight data i.e. "OLS" or "VIIRS"

Value

the updated dataframe

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
ctryNlDataDF <- Rnightlights:::insertNlDataCol(ctryNlDataDF, 
    dataCol, "sum", "201409", "VIIRS")
    
# }
# NOT RUN {
# }
# NOT RUN {
ctryNlDataDF <- Rnightlights:::insertNlDataCol(ctryNlDataDF, 
    dataCol, "mean", "2012", "OLS")
    
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab