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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: bbox_to_SpatialPolygons
> ### Title: Create a SpatialPolygons Bounding Box
> ### Aliases: bbox_to_SpatialPolygons
> 
> ### ** Examples
> 
> library("raster")
Loading required package: sp
> tahoe_highrez <- brick(system.file("external/tahoe_highrez.tif", package="spatial.tools"))
> bbox_to_SpatialPolygons(tahoe_highrez)
class       : SpatialPolygons 
features    : 1 
extent      : -119.9328, -119.9306, 39.28922, 39.29141  (xmin, xmax, ymin, ymax)
crs         : +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0 
> tahoe_highrez_extent <- extent(tahoe_highrez)
> bbox_to_SpatialPolygons(tahoe_highrez_extent,
+ 	CRS("+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0"))
class       : SpatialPolygons 
features    : 1 
extent      : -119.9328, -119.9306, 39.28922, 39.29141  (xmin, xmax, ymin, ymax)
crs         : +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0 
> tahoe_highrez_bbox <- bbox(tahoe_highrez)
> bbox_to_SpatialPolygons(tahoe_highrez_bbox,
+ 	CRS("+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0"))
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
spatial.tools
 --- call from context --- 
bbox_to_SpatialPolygons(tahoe_highrez_bbox, CRS("+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0"))
 --- call from argument --- 
if (class(x) == "character") {
    x <- brick(x)
}
 --- R stacktrace ---
where 1: bbox_to_SpatialPolygons(tahoe_highrez_bbox, CRS("+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0"))

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (x, proj4string = CRS(as.character(NA))) 
{
    if (class(x) == "character") {
        x <- brick(x)
    }
    if (class(x) == "RasterLayer" || class(x) == "RasterBrick" || 
        class(x) == "RasterStack") {
        bbox <- bbox(x)
        proj4string <- CRS(projection(x))
    }
    if (class(x) == "Extent") {
        bbox <- matrix(c(x@xmin, x@ymin, x@xmax, x@ymax), nrow = 2, 
            ncol = 2)
    }
    if (class(x) == "matrix") {
        bbox <- x
    }
    coords <- rbind(c(bbox[1, 1], bbox[2, 1]), c(bbox[1, 2], 
        bbox[2, 1]), c(bbox[1, 2], bbox[2, 2]), c(bbox[1, 1], 
        bbox[2, 2]), c(bbox[1, 1], bbox[2, 1]))
    bboxPolygon <- Polygon(coords)
    bboxPolygons <- Polygons(list(bboxPolygon), ID = 1)
    bboxSpatialPolygons <- SpatialPolygons(list(bboxPolygons), 
        proj4string = proj4string)
    return(bboxSpatialPolygons)
}
<bytecode: 0x559b66b239c0>
<environment: namespace:spatial.tools>
 --- function search by body ---
Function bbox_to_SpatialPolygons in namespace spatial.tools has this body.
 ----------- END OF FAILURE REPORT -------------- 
Error in if (class(x) == "character") { : the condition has length > 1
Calls: bbox_to_SpatialPolygons
Execution halted