Create a zonal file if it does not exist and calculate the zonal stats by calling the myZonal function. Modified from http://www.guru-gis.net/efficient-zonal-statistics-using-r-and-gdal/
ZonalPipe(ctryCode, ctryPoly, path.in.shp, path.in.r, path.out.r, path.out.shp,
zone.attribute, stats)
the ctryCode of interest
the SpatialPolygonsDataFrame country polygon to process
The path to the country shapefile
The path to the raster tile
The path where to save the output zonal raster
The path to save the output zonal shapefile (Ignored)
The zonal attribute to calculate
The stats to calculate
TRUE/FALSE