myZonal: Calculate zonal statistics. Used internally

Description Usage Arguments Value

Description

Calculate zonal statistics. Used internally by zonalpipe. Modified from http://www.guru-gis.net/efficient-zonal-statistics-using-r-and-gdal/

Usage

1
2
myZonal(rast, nlType, configName, zone, nlStats, digits = 0,
  retVal = NULL, na.rm = TRUE, ...)

Arguments

rast

the country raster

nlType

the nlType of interest

configName

character the type of raster being processed

zone

the zonal country polygon layer

nlStats

a character list of statistics to calculate

digits

round off to how many decimals

retVal

Whether to return the raster data as a vector, or data.frame with spatial context NULL returns a vector of all values, colrowval returns a data.frame with row, col and raster value while lonlatval returns a data.frame with lon,lat and val.

na.rm

how to handle NAs

...

Other params to pass to the nlStats functions e.g. na.rm

Value

numeric value result of the given nlStat function


Rnightlights documentation built on Aug. 29, 2019, 5:02 p.m.