Learn R Programming

Rnightlights (version 0.1.2)

plotCtryWithTilesVIIRS: Plot a country polygon against a background of the VIIRS tiles and world map

Description

Plot a country polygon as defined in the rworldmap package along with the VIIRS nightlight tiles for a visual inspection of the tiles required for download in order to process a country's nightlight data. Output corresponds to that of getCtryNlTiles()

It utilizes rworldmap::rwmgetISO3() to resolve country codes as well as names

Usage

plotCtryWithTilesVIIRS(idx)

Arguments

idx

character string or integer either the index of the country polygon in rworldmap::getMap() or the 3-letter ISO3 country code e.g. "KEN" or a common name of the country e.g. "Kenya" as found valid by rworldmap::rwmgetISO3()

Value

None

Examples

Run this code
# NOT RUN {
#by ctryCode
plotCtryWithTilesVIIRS("KEN")

#by index in rworldmap
# }
# NOT RUN {
plotCtryWithTilesVIIRS(115)
# }
# NOT RUN {
#by index passed as char string
# }
# NOT RUN {
plotCtryWithTilesVIIRS("24")
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab