Calculate zonal statistics. Used internally by zonalpipe. Modified from http://www.guru-gis.net/efficient-zonal-statistics-using-r-and-gdal/
myZonal(rast, nlType, configName, zone, nlStats, digits = 0,
retVal = NULL, na.rm = TRUE, ...)
the country raster
the nlType of interest
character the type of raster being processed
the zonal country polygon layer
a character list of statistics to calculate
round off to how many decimals
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.
how to handle NAs
Other params to pass to the nlStats functions e.g. na.rm
numeric value result of the given nlStat function