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
 3
 4
 5
 6
 7
 8
 9
10
11
12
myZonal(
  rast,
  nlType,
  configName,
  extension,
  zone,
  nlStats,
  digits = 0,
  retVal = NULL,
  na.rm = TRUE,
  ...
)

Arguments

rast

the country raster

nlType

the nlType of interest

configName

character the config shortname of raster being processed

extension

character the extension 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


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