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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: geocode
> ### Title: Georeferencing with Google
> ### Aliases: geocode
> 
> ### ** Examples
> 
> 
> 
> 
> if(requireNamespace("rgdal", quietly = TRUE)) { 
+ 
+ cities=try(geocode('Ulan batar'), silent=TRUE)
+ if(class(cities) != 'try-error') {
+ mytiles = openmap(cities, buffer=800*1000, maxTiles=1)
+ 
+ map.new(mytiles)
+ plot(mytiles, add=TRUE)
+ points(cities, col='red')
+ text(cities, labels=cities$name, col='red',pos=4)
+ }
+ 
+ }
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
mapmisc
 --- call from context --- 
openmap(cities, buffer = 800 * 1000, maxTiles = 1)
 --- call from argument --- 
if (class(bboxx) != "try-error" & class(projx) != "try-error") {
    if (identical(projx, crsOut)) {
        bigExtent = extend(extent(x), buffer + abs(as.numeric(apply(bboxx, 
            1, diff))/2))
        toRaster = raster::crop(toRaster, bigExtent)
    }
}
 --- R stacktrace ---
where 1: openmap(cities, buffer = 800 * 1000, maxTiles = 1)

 --- value of length: 2 type: logical ---
[1] TRUE TRUE
 --- function from context --- 
function (x, zoom, path = "http://tile.openstreetmap.org/", maxTiles = 9, 
    crs = projection(x), buffer = 0, fact = 1, verbose = getOption("mapmiscVerbose"), 
    cachePath = getOption("mapmiscCachePath")) 
{
    verbose = max(c(0, verbose))
    if (is.null(cachePath)) {
        cachePath = tempdir()
    }
    if (!nchar(cachePath)) {
        cachePath = "."
    }
    alltiles = osmTiles()
    pathOrig = path
    pathisname = gsub("-", ".", pathOrig) %in% gsub("-", ".", 
        names(alltiles))
    path[pathisname] = alltiles[path[pathisname]]
    if (length(grep("[[:punct:]]$", path, invert = TRUE))) 
        path[grep("[[:punct:]]$", path, invert = TRUE)] = paste(path[grep("[[:punct:]]$", 
            path, invert = TRUE)], "/", sep = "")
    if (length(grep("^http[s]*://", path, invert = TRUE))) 
        path[grep("^http[s]*://", path, invert = TRUE)] = paste("http://", 
            path[grep("^http[s]*://", path, invert = TRUE)], 
            sep = "")
    names(path) = pathOrig
    if (all(class(x) == "CRS")) {
        crs = x
        toCrop = attributes(x)$ellipse
        x = attributes(x)$regionLL
    }
    else {
        toCrop = NULL
    }
    crsOut = crs
    crsIn = crs(x)
    if (all(is.na(crsIn))) {
        if (is.vector(x)) {
            crsIn = crsLL
        }
        else {
            crsIn = crs
        }
    }
    extMerc = .getExtent(x, crsIn, buffer, crsMerc)
    extMerc = .cropExtent(extMerc, extentMerc)
    if (missing(zoom)) {
        zoom = 1
        while (nTilesMerc(extMerc, zoom) <= maxTiles & zoom <= 
            18) {
            zoom = zoom + 1
        }
        zoom = min(c(18, max(c(1, zoom - 1))))
    }
    if (verbose) 
        cat("zoom is ", zoom, ", ", nTilesMerc(extMerc, zoom), 
            "tiles\n")
    result = NULL
    for (Dpath in rev(names(path))) {
        Durl = path[Dpath]
        if (verbose) {
            cat(Dpath, "\n")
            cat(Durl, "\n")
        }
        if (length(grep("nrcan\\.gc\\.ca|gov\\.bc\\.ca", Durl))) {
            suffix = ""
            tileNames = "zyx"
        }
        else if (length(grep("[.]arcgisonline[.]com", Durl))) {
            suffix = ".jpg"
            tileNames = "zyx"
        }
        else if (length(grep("heidelberg.de/tiles/(hybrid|adminb|roadsg|roads)/?$", 
            Durl)) | length(grep("&$", Durl))) {
            tileNames = "xyz="
            suffix = ""
        }
        else {
            suffix = ".png"
            tileNames = "zxy"
        }
        if (length(attributes(pathOrig)$tileNames)) 
            tileNames = attributes(pathOrig)$tileNames
        if (length(attributes(pathOrig)$suffix)) 
            suffix = attributes(pathOrig)$suffix
        thistile = try(getTilesMerc(extMerc, zoom = zoom, path = Durl, 
            verbose = verbose, suffix = suffix, tileNames = tileNames, 
            cachePath = cachePath), silent = !verbose)
        if (class(thistile) == "try-error") {
            message(paste(Durl, "not accessible"))
            thistile = NULL
        }
        else {
            if (length(names(thistile))) {
                theprefix = strsplit(names(thistile), "([rR]ed|[gG]reen|[bB]lue)$", 
                  fixed = FALSE)[[1]]
                names(thistile) = gsub(theprefix, paste(Dpath, 
                  "", sep = ""), names(thistile), fixed = TRUE)
            }
            ctable = NULL
            if (!is.null(thistile)) {
                if (nlayers(thistile) == 1) 
                  ctable = thistile@legend@colortable
                if (is.null(result)) {
                  result = stack(thistile)
                }
                else {
                  result = stack(result, thistile)
                }
            }
        }
    }
    if (is.null(result)) {
        result = raster(extMerc, 1, 1, crs = crsMerc)
        values(result) = NA
        attributes(result)$openmap = list(tiles = NA, message = thistile, 
            path = path, zoom = zoom)
    }
    if (!is.na(crsOut)) {
        oldColorTable = list()
        for (D in names(result)) oldColorTable[[D]] = result[[D]]@legend@colortable
        if (verbose) 
            cat("reprojecting ", ncell(result), " cells...")
        if (!compareCRS(projection(result), crsOut)) {
            toRaster = projectExtent(result, crsOut)
            bboxx = try(bbox(extend(extent(x), buffer)), silent = TRUE)
            if (any(apply(bboxx, 1, diff) < .Machine$double.eps)) {
                class(bboxx) = "try-error"
            }
            projx = try(proj4string(x), silent = TRUE)
            if (class(bboxx) != "try-error" & class(projx) != 
                "try-error") {
                if (identical(projx, crsOut)) {
                  bigExtent = extend(extent(x), buffer + abs(as.numeric(apply(bboxx, 
                    1, diff))/2))
                  toRaster = raster::crop(toRaster, bigExtent)
                }
            }
            if (any(fact > 1)) {
                res(toRaster) = res(toRaster)/rep_len(fact, 2)
            }
            resultProj1 = suppressWarnings(projectRaster(result, 
                toRaster, method = "ngb"))
            resultProj = stack(resultProj1)
            for (D in names(resultProj)) resultProj[[D]]@legend@colortable = oldColorTable[[D]]
            if (verbose) 
                cat("done\n")
        }
        else {
            if (any(fact < 1)) {
                fact = pmax(1, round(1/fact))
                if (any(fact > 1)) {
                  if (verbose) 
                    cat("aggregating tiles by ", fact, "\n")
                  resultProj = stack(aggregate(result, fact = fact, 
                    fun = min))
                  for (D in names(resultProj)) resultProj[[D]]@legend = result[[D]]@legend
                }
            }
            else {
                if (verbose) 
                  cat("tiles arrived in the desired projection\n")
                resultProj = stack(result)
            }
        }
    }
    else {
        resultProj = stack(result)
    }
    for (D in names(resultProj)) {
        if (length(result[[D]]@legend@colortable)) {
            if (verbose) 
                cat("copying colortable for ", D, "\n")
            resultProj[[D]]@legend@colortable = result[[D]]@legend@colortable
            if (any(values(resultProj[[D]]) == 0, na.rm = TRUE) | 
                any(is.na(values(resultProj[[D]])))) {
                resultProj[[D]]@legend@colortable = c("#FFFFFF00", 
                  resultProj[[D]]@legend@colortable)
                values(resultProj[[D]]) = 1 + values(resultProj[[D]])
            }
        }
    }
    if (nlayers(resultProj) == 1) 
        resultProj = resultProj[[1]]
    attributes(resultProj)$tiles = attributes(thistile)$tiles
    attributes(resultProj)$tiles$path = path
    resultProj
}
<bytecode: 0x560e38b5aa40>
<environment: namespace:mapmisc>
 --- function search by body ---
Function openmap in namespace mapmisc has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1