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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: partitions
> ### Title: Methods to partition data for evaluation
> ### Aliases: partitions get.block get.checkerboard1 get.checkerboard2
> ###   get.jackknife get.randomkfold
> 
> ### ** Examples
> 
> require(raster)
Loading required package: raster
Loading required package: sp
> 
> set.seed(1)
> 
> ### Create environmental extent (raster)
> envs <- raster(matrix(nrow=25, ncol=25))
> 
> ### Create occurrence localities
> set.seed(1)
> nocc <- 25
> xocc <- rnorm(nocc, sd=0.25) + 0.5
> yocc <- runif(nocc, 0, 1)
> occs <- as.data.frame(cbind(xocc, yocc))
> 
> ### Create background points
> nbg <- 500
> xbg <- runif(nbg, 0, 1)
> ybg <- runif(nbg, 0, 1)
> bg <- as.data.frame(cbind(xbg, ybg))
> 
> ### Plot points on environmental raster
> plot(envs)
> points(bg)
> points(occs, pch=21, bg=2)
> 
> ### Block partitioning method (default orientation is "lat_lon"))
> blk.latLon <- get.block(occs, bg)
> plot(envs)
> points(occs, pch=23, bg=blk.latLon$occs.grp)
> plot(envs)
> points(bg, pch=21, bg=blk.latLon$bg.grp)
> # Can partition with other orientations
> blk.latLat <- get.block(occs, bg, orientation = "lat_lat")
> plot(envs)
> points(occs, pch=23, bg=blk.latLat$occs.grp)
> plot(envs)
> points(bg, pch=21, bg=blk.latLat$bg.grp)
> 
> ### Checkerboard1 partitioning method with aggregation factor of 4
> chk1.ag4 <- get.checkerboard1(occs, envs, bg, aggregation.factor = 4)
> plot(envs)
> points(occs, pch=23, bg=chk1.ag4$occs.grp)
> plot(envs)
> points(bg, pch=21, bg=chk1.ag4$bg.grp)
> # Higher aggregation factors result in bigger checkerboard blocks
> chk1.ag8 <- get.checkerboard1(occs, envs, bg, aggregation.factor = 8)
> plot(envs)
> points(occs, pch=23, bg=chk1.ag8$occs.grp)
> plot(envs)
> points(bg, pch=21, bg=chk1.ag8$bg.grp)
> 
> ### Checkerboard2 partitioning method with aggregation factors of 2, 2
> chk2.ag2_2 <- get.checkerboard2(occs, envs, bg, c(2,2))
> plot(envs)
> points(occs, pch=23, bg=chk2.ag2_2$occs.grp)
> plot(envs)
> points(bg, pch=21, bg=chk2.ag2_2$bg.grp)
> # Higher aggregation factors result in bigger checkerboard blocks,
> # and can vary between hierarchical levels
> chk2.ag4_6 <- get.checkerboard2(occs, envs, bg, c(4,6))
Warning: occurrence points fall in only 2 bins
> plot(envs)
> points(occs, pch=23, bg=chk2.ag4_6$occs.grp)
> plot(envs)
> points(bg, pch=21, bg=chk2.ag4_6$bg.grp)
> 
> ### Random partitions with 4 folds
> # Note that get.randomkkfold does not partition the background
> krandom <- get.randomkfold(occs, bg, 4)
Error in singlefold(obs, k) : insufficient records:2, with k=4
Calls: get.randomkfold -> <Anonymous> -> singlefold
Execution halted