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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: OCSVMprofiling
> ### Title: Environmental profiling with One-Classification Support Vector
> ###   Machine
> ### Aliases: OCSVMprofiling
> 
> ### ** Examples
> 
> ## Load presence data
> data(Oak_phylo2)
> 
> ## Load climate data
> destfile <- tempfile()
> data.url <- "https://raw.githubusercontent.com/SantanderMetGroup/mopa/master/data/biostack.rda"
> download.file(data.url, destfile)
trying URL 'https://raw.githubusercontent.com/SantanderMetGroup/mopa/master/data/biostack.rda'
Content type 'application/octet-stream' length 6885444 bytes (6.6 MB)
==================================================
downloaded 6.6 MB

> load(destfile, verbose = TRUE)
Loading objects:
  biostack
> 
> ## Spatial reference
> projection(biostack$baseline) <- CRS("+proj=longlat +init=epsg:4326")
> r <- biostack$baseline[[1]]
> ## Background of the whole study area
> bg <- backgroundGrid(r)
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
mopa
 --- call from context --- 
boundingCoords(coordinates(sp_grid))
 --- call from argument --- 
if (class(xy) == "matrix") xy <- as.data.frame(xy)
 --- R stacktrace ---
where 1: boundingCoords(coordinates(sp_grid))
where 2: backgroundGrid(r)

 --- value of length: 2 type: logical ---
[1]  TRUE FALSE
 --- function from context --- 
function (xy) 
{
    if (class(xy) == "matrix") 
        xy <- as.data.frame(xy)
    if (class(xy) == "data.frame") {
        pres.list <- list(xy)
    }
    else {
        pres.list <- xy
    }
    box <- numeric()
    l.box <- list()
    for (i in 1:length(pres.list)) {
        length(l.box) <- i
        box[1] <- min(pres.list[[i]][, 1])
        box[2] <- max(pres.list[[i]][, 1])
        box[3] <- min(pres.list[[i]][, 2])
        box[4] <- max(pres.list[[i]][, 2])
        l.box[[i]] <- box
    }
    names(l.box) <- names(pres.list)
    return(l.box)
}
<bytecode: 0xb188078>
<environment: namespace:mopa>
 --- function search by body ---
Function boundingCoords in namespace mopa has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1