Learn R Programming

Rnightlights (version 0.1.2)

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, stats, digits = 0, na.rm = TRUE, ...)

Arguments

x

the country raster

z

the zonal country polygon layer

stats

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 stats function

Value

numeric value result of the given stat function