Calculate zonal statistics. Used internally by zonalpipe. Modified from http://www.guru-gis.net/efficient-zonal-statistics-using-r-and-gdal/
myZonal(x, z, stats, digits = 0, na.rm = TRUE, ...)the country raster
the zonal country polygon layer
a character list of statistics to calculate
round off to how many decimals
how to handle NAs
Other params to pass to the stats function
numeric value result of the given stat function