plotCtryNlData: Plots the ctryNlData

Description Usage Arguments Value Examples

View source: R/visualizations.R

Description

Plots the ctryNlData in various plot styles including line, box and density plot using ggplot2. If ctryData is not provided the subsequent parameters will need to be supplied so thta getCtryNlData can be used to retrieve the data prior to plotting.

Usage

1
2
3
4
5
6
7
8
plotCtryNlData(
  ctryData,
  admLevelFilters = NULL,
  scale = FALSE,
  graphType = "line",
  normArea = FALSE,
  plotly = TRUE
)

Arguments

ctryData

data.frame If provided the plot will use data from it rather than retrieving it. If not available the follow parameters are required to retrieve the data using getCtryNlData.

It is assumed that the ctryData data.frame is in the same format as the output from getCtryNlData i.e. admin cols first, an area column, followed by the stat columns. In future it may be possible to supply a custom data.frame and direct the function on which columns to find the particular data.

admLevelFilters

character The admLevel members that are selected the rest will be filtered out

ctryCode

character The ctryCode of interest

admLevel

character The country admin level in the given ctryCode at which to calculate stats

nlType

character The nlType of interest

configName

character the config shortname of raster being processed

extension

character the extension of raster being processed

multiTileStrategy

character How to handle multiple tiles per nlPeriod

multiTileMergeFun

character The function to use to merge tiles

removeGasFlaresMethod

character The method to use to perform gas flare removal or NULL to disable

nlPeriod

character The nlPeriod of interest

nlStats

the statistics to calculate. If not provided will calculate the stats specified in pkgOptions("nlStats")

downloadMethod

The method used to download polygons and rasters

cropMaskMethod

character Whether to use rasterize or gdal-based functions to crop and mask the country rasters

extractMethod

("rast" or "gdal") Whether to use rasterize or gdal-based functions to crop and mask the country rasters

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

None

Examples

1
2
3
4
5
6
#calculate only the sum of monthly VIIRS radiances for Dec 2014 using gdal
#for both cropMask and extraction for KEN
## Not run: 
Rnightlights:::processNLCountry("KEN", "KEN_adm2", "VIIRS.M", "201412", "gdal", "gdal", "sum")

## End(Not run)

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