Learn R Programming

Rnightlights (version 0.1.5)

myZonal: Calculate zonal statistics. Used internally

Description

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

Usage

myZonal(x, z, nlStats, digits = 0, na.rm = TRUE, ...)

Arguments

x

the country raster

z

the zonal country polygon layer

nlStats

a character list of statistics to calculate

digits

round off to how many decimals

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