Running examples in 'agriwater-Ex.R' failed
The error most likely occurred in:

> ### Name: evapo_modis
> ### Title: Actual evapotranspiration (ETa) using MODIS with single
> ###   agrometeorological data.
> ### Aliases: evapo_modis
> 
> ### ** Examples
> 
> library(agriwater)
> 
> # dependencies of package 'agriwater'
> library(sp)
> library(raster)
> library(rgdal)
rgdal: version: 1.5-21, (SVN revision 1105)
Geospatial Data Abstraction Library extensions to R successfully loaded
Loaded GDAL runtime: GDAL 3.0.4, released 2020/01/28
Path to GDAL shared files: D:/temp/RtmpqIZyWa/RLIBS_12f582bfb32e2/rgdal/gdal
GDAL binary built with GEOS: TRUE 
Loaded PROJ runtime: Rel. 6.3.1, February 10th, 2020, [PJ_VERSION: 631]
Path to PROJ shared files: D:/temp/RtmpqIZyWa/RLIBS_12f582bfb32e2/rgdal/proj
Linking to sp version:1.4-5
To mute warnings of possible GDAL/OSR exportToProj4() degradation,
use options("rgdal_show_exportToProj4_warnings"="none") before loading rgdal.
> 
> # Using a temporary folder to run example
> wd <- tempdir()
> initial = getwd()
> setwd(wd)
> 
> 
> # creating raster which simulate Sentinel-2 reflectances - for using
> # real data, please download:
> # https://drive.google.com/open?id=14E1wHNLxG7_Dh4I-GqNYakj8YJDgKLzk
> 
> wd <- tempdir()
> xy <- matrix(rnorm(100, mean = 0.07, sd = 0.01), 10, 10)
> rast <- raster(xy)
> extent(rast) <- c(-40.5,-40.45,-9.5,-9.45)
> projection(rast) <- CRS("+proj=longlat +datum=WGS84")
> writeRaster(rast, file.path(wd, "B2"),format = "GTiff", overwrite=TRUE)
> xy <- matrix(rnorm(100, mean = 0.05, sd = 0.015),10, 10)
> rast <- raster(xy)
> extent(rast) <- c(-40.5,-40.45,-9.5,-9.45)
> projection(rast) <- CRS("+proj=longlat +datum=WGS84")
> writeRaster(rast, file.path(wd, "B1"),format = "GTiff", overwrite=TRUE)
> 
> mask <- as(extent(rast), 'SpatialPolygons')
> projection(mask) <- CRS("+proj=longlat +datum=WGS84")
> shapefile(mask, file.path(wd,"mask.shp"), overwrite=TRUE)
Error in rgdal::writeOGR(x, filename, layer, driver = "ESRI Shapefile",  : 
  Spatial Polygons objects should have valid ordering comments
use rgeos::createSPComment()
Calls: shapefile -> shapefile -> .local -> <Anonymous>
Execution halted