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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: Rgshhs
> ### Title: Read GSHHS data into sp object
> ### Aliases: Rgshhs getRgshhsMap
> ### Keywords: spatial
> 
> ### ** Examples
> 
> if (rgeosStatus()) {
+ gshhs.c.b <- system.file("share/gshhs_c.b", package="maptools")
+ WEx <- c(-12, 3)
+ WEy <- c(48, 59)
+ WE <- getRgshhsMap(gshhs.c.b, xlim=WEx, ylim=WEy)
+ plot(WE, col="khaki", xlim=WEx, ylim=WEy, xaxs="i", yaxs="i", axes=TRUE)
+ NZx <- c(160,180)
+ NZy <- c(-50,-30)
+ NZ <- Rgshhs(gshhs.c.b, xlim=NZx, ylim=NZy)
+ plot(NZ$SP, col="khaki", pbg="azure2", xlim=NZx, ylim=NZy, xaxs="i", yaxs="i", axes=TRUE)
+ GLx <- c(265,285)
+ GLy <- c(40,50)
+ GL <- Rgshhs(gshhs.c.b, xlim=GLx, ylim=GLy)
+ plot(GL$SP, col="khaki", pbg="azure2", xlim=GLx, ylim=GLy, xaxs="i", yaxs="i", axes=TRUE)
+ BNLx <- c(2,8)
+ BNLy <- c(49,54)
+ wdb_lines <- system.file("share/wdb_borders_c.b", package="maptools")
+ BNLp <- Rgshhs(gshhs.c.b, xlim=BNLx, ylim=BNLy)
+ BNLl <- Rgshhs(wdb_lines, xlim=BNLx, ylim=BNLy)
+ plot(BNLp$SP, col="khaki", pbg="azure2", xlim=BNLx, ylim=BNLy, xaxs="i", yaxs="i", axes=TRUE)
+ lines(BNLl$SP)
+ xlims <- c(0,360)
+ ylims <- c(-90,90)
+ world <- Rgshhs(gshhs.c.b, xlim=xlims, ylim=ylims, level=1, checkPolygons=TRUE)
+ }
Data are polygon data
Rgshhs: clipping 1 of 2 polygons ...
Data are polygon data
Rgshhs: clipping 1 of 11 polygons ...
Data are polygon data
Data are polygon data
Rgshhs: clipping 9 of 49 polygons ...
Data are polygon data
Rgshhs: clipping 1 of 2 polygons ...
Data are line data
Data are polygon data
Rgshhs: clipping 3 of 739 polygons ...
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
maptools
 --- call from context --- 
checkPolygonsGEOS(pls0, properly = properly)
 --- call from argument --- 
if (class(res) == "try-error") {
    warning("Polygons object ", IDs, ", Polygon ", i, ": ", res)
    next
}
 --- R stacktrace ---
where 1: checkPolygonsGEOS(pls0, properly = properly)
where 2: Rgshhs(gshhs.c.b, xlim = xlims, ylim = ylims, level = 1, checkPolygons = TRUE)

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (obj, properly = TRUE, force = TRUE, useSTRtree = FALSE) 
{
    if (!is(obj, "Polygons")) 
        stop("not a Polygons object")
    if (!requireNamespace("rgeos", quietly = TRUE)) 
        stop("package rgeos required for checkPolygonsGEOS")
    comm <- try(rgeos::createPolygonsComment(obj), silent = TRUE)
    if (class(comm) != "try-error" && !force) {
        comment(obj) <- comm
        return(obj)
    }
    pls <- slot(obj, "Polygons")
    IDs <- slot(obj, "ID")
    n <- length(pls)
    if (n < 1) 
        stop("Polygon list of zero length")
    uniqs <- rep(TRUE, n)
    if (n > 1) {
        if (useSTRtree) 
            tree1 <- rgeos::gUnarySTRtreeQuery(obj)
        SP <- SpatialPolygons(lapply(1:n, function(i) Polygons(list(pls[[i]]), 
            ID = i)))
        for (i in 1:(n - 1)) {
            if (useSTRtree) {
                if (!is.null(tree1[[i]])) {
                  res <- try(rgeos::gEquals(SP[i, ], SP[tree1[[i]], 
                    ], byid = TRUE), silent = TRUE)
                  if (class(res) == "try-error") {
                    warning("Polygons object ", IDs, ", Polygon ", 
                      i, ": ", res)
                    next
                  }
                  if (any(res)) {
                    uniqs[as.integer(rownames(res)[res])] <- FALSE
                  }
                }
            }
            else {
                res <- try(rgeos::gEquals(SP[i, ], SP[uniqs, 
                  ], byid = TRUE), silent = TRUE)
                if (class(res) == "try-error") {
                  warning("Polygons object ", IDs, ", Polygon ", 
                    i, ": ", res)
                  next
                }
                res[i] <- FALSE
                if (any(res)) {
                  wres <- which(res)
                  uniqs[wres[wres > i]] <- FALSE
                }
            }
        }
    }
    if (any(!uniqs)) 
        warning(paste("Duplicate Polygon objects dropped:", paste(wres, 
            collapse = " ")))
    pls <- pls[uniqs]
    n <- length(pls)
    if (n < 1) 
        stop("Polygon list of zero length")
    if (n == 1) {
        oobj <- Polygons(pls, ID = IDs)
        comment(oobj) <- rgeos::createPolygonsComment(oobj)
        return(oobj)
    }
    areas <- sapply(pls, slot, "area")
    pls <- pls[order(areas, decreasing = TRUE)]
    oholes <- sapply(pls, function(x) slot(x, "hole"))
    holes <- rep(FALSE, n)
    SP <- SpatialPolygons(lapply(1:n, function(i) Polygons(list(pls[[i]]), 
        ID = i)))
    if (useSTRtree) 
        tree2 <- rgeos::gUnarySTRtreeQuery(SP)
    for (i in 1:(n - 1)) {
        if (useSTRtree) {
            if (!is.null(tree2[[i]])) {
                if (properly) 
                  res <- rgeos::gContainsProperly(SP[i, ], SP[tree2[[i]], 
                    ], byid = TRUE)
                else res <- rgeos::gContains(SP[i, ], SP[tree2[[i]], 
                  ], byid = TRUE)
            }
            else {
                res <- FALSE
            }
        }
        else {
            if (properly) 
                res <- rgeos::gContainsProperly(SP[i, ], SP[-(1:i), 
                  ], byid = TRUE)
            else res <- rgeos::gContains(SP[i, ], SP[-(1:i), 
                ], byid = TRUE)
        }
        wres <- which(res)
        if (length(wres) > 0L) {
            nres <- as.integer(rownames(res))
            holes[nres[wres]] <- !holes[nres[wres]]
        }
    }
    for (i in 1:n) {
        if (oholes[i] != holes[i]) 
            pls[[i]] <- Polygon(slot(pls[[i]], "coords"), hole = holes[i])
    }
    oobj <- Polygons(pls, ID = IDs)
    comment(oobj) <- rgeos::createPolygonsComment(oobj)
    oobj
}
<bytecode: 0x55964bce27b0>
<environment: namespace:maptools>
 --- function search by body ---
Function checkPolygonsGEOS in namespace maptools has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1