Running examples in ‘geosample-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: discrete.inhibit.sample
> ### Title: Spatially discrete sampling
> ### Aliases: discrete.inhibit.sample
> 
> ### ** Examples
> 
> library("sf")
> set.seed(1234)
> x <- 0.015+0.03*(1:33)
> xall <- rep(x,33)
> yall <- c(t(matrix(xall,33,33)))
> xy <- cbind(xall,yall)+matrix(-0.0075+0.015*runif(33*33*2),33*33,2)
> 
> 
> # Convert to SF object
> xy <- xy %>%
+   as.data.frame %>%
+   sf::st_as_sf(coords = c(1,2))
> 
> 
> # Plot the points
> plot(st_geometry(xy),pch=19,cex=0.25,xlab="longitude",ylab="latitude",
+      cex.lab=1,cex.axis=1,cex.main=1, axes = TRUE)
> 
> 
> # Generate spatially random sample
> set.seed(15892)
> xy.sample1 <- xy[sample(1:dim(xy)[1],50,replace=FALSE),]
> plot(xy.sample1, pch = 19, col = 'black', add = TRUE)
> 
> 
> set.seed(15892)
> xy.sample2 <- discrete.inhibit.sample(obj=xy,size = 100,
+                                       delta = 0.08,plotit = TRUE)
> plot(st_geometry(xy),pch=19, cex = 0.25, col="black", add = TRUE)
> 
> 
> # Generate spatially inhibitory sample
> # with close pairs (cp.zeta criterion):
> set.seed(15892)
> xy.sample3 <- discrete.inhibit.sample(obj=xy, size = 100,delta = 0.065,
+                                      k = 25,cp.criterion = "cp.zeta",
+                                      zeta = 0.025, plotit = TRUE)
> plot(st_geometry(xy),pch=19, cex = 0.25, col="black", add = TRUE)
> 
> 
> # Generate spatially inhibitory sample
> # with close pairs (cp.neighb criterion):
> set.seed(15892)
> xy.sample4 <- discrete.inhibit.sample(obj=xy,size = 100,
+                                       delta = 0.065, k = 25,cp.criterion = "cp.neighb",
+                                       plotit = TRUE)
> plot(st_geometry(xy),pch=19, cex = 0.25, col="black", add = TRUE)
> 
> 
> # Generate spatially inhibitory sample
> # with close pairs (cp.zeta criterion):
> set.seed(15892)
> xy.sample5 <- discrete.inhibit.sample(obj=xy,size = 100,
+                                       delta = 0.065, cp.criterion = "cp.zeta",
+                                       zeta = 0.025, delta.fix = TRUE,
+                                       k = 25, plotit = TRUE)
> plot(st_geometry(xy),pch=19, cex = 0.25, col="black", add = TRUE)
> 
> 
> # Generate simple inhibitory sample from a regular grid
> library("PrevMap")
Loading required package: maxLik
Loading required package: miscTools

Please cite the 'maxLik' package as:
Henningsen, Arne and Toomet, Ott (2011). maxLik: A package for maximum likelihood estimation in R. Computational Statistics 26(3), 443-458. DOI 10.1007/s00180-010-0217-1.

If you have questions, suggestions, or comments regarding the 'maxLik' package, please use a forum or 'tracker' at maxLik's R-Forge site:
https://r-forge.r-project.org/projects/maxlik/
Loading required package: raster

Attaching package: ‘raster’

The following object is masked from ‘package:maxLik’:

    maxValue

Loading required package: pdist
Loading required package: Matrix
> data("sim.data")
> set.seed(15892)
> xy.sample6 <- discrete.inhibit.sample(obj = sim.data,
+                                       size = 50, delta = 0.08,plotit = TRUE)
OGR: Corrupt data
Error in CPL_area(x) : OGR error
Calls: discrete.inhibit.sample -> <Anonymous> -> st_area.sfc -> CPL_area
Execution halted