Calculate zonal statistics. Used internally by zonalpipe. Modified from http://www.guru-gis.net/efficient-zonal-statistics-using-r-and-gdal/
myZonal(x, z, nlStats, 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 nlStats functions e.g. na.rm
numeric value result of the given nlStat function