CRAN Package Check Results for Package mapmisc

Last updated on 2019-11-26 00:51:57 CET.

Flavor Version Tinstall Tcheck Ttotal Status Flags
r-devel-linux-x86_64-debian-clang 1.7.5 11.71 178.97 190.68 ERROR
r-devel-linux-x86_64-debian-gcc 1.7.5 11.28 139.66 150.94 ERROR
r-devel-linux-x86_64-fedora-clang 1.7.5 328.66 NOTE
r-devel-linux-x86_64-fedora-gcc 1.7.5 327.02 NOTE
r-devel-windows-ix86+x86_64 1.7.5 29.00 340.00 369.00 OK
r-devel-windows-ix86+x86_64-gcc8 1.7.5 34.00 252.00 286.00 OK
r-patched-linux-x86_64 1.7.5 10.64 257.63 268.27 OK
r-patched-solaris-x86 1.7.5 494.90 NOTE
r-release-linux-x86_64 1.7.5 10.69 260.16 270.85 OK
r-release-windows-ix86+x86_64 1.7.5 26.00 254.00 280.00 OK
r-release-osx-x86_64 1.7.5 NOTE
r-oldrel-windows-ix86+x86_64 1.7.5 14.00 328.00 342.00 OK
r-oldrel-osx-x86_64 1.7.5 NOTE

Check Details

Version: 1.7.5
Check: examples
Result: ERROR
    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: 0x832eee0>
    <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
Flavor: r-devel-linux-x86_64-debian-clang

Version: 1.7.5
Check: tests
Result: ERROR
     Running 'colourScale.R' [4s/5s]
     Running 'omerc.R' [12s/13s]
     Running 'openmap.R' [10s/12s]
     Running 'worldMap.R' [14s/16s]
    Running the tests in 'tests/openmap.R' failed.
    Complete output:
     > #+ setup
     > library('mapmisc')
     Loading required package: sp
     Loading required package: raster
     map images will be cached in /tmp/RtmpXiedGi/mapmiscCache
     >
     > if(!exists('mapmiscCachePath'))
     + mapmiscCachePath = system.file('extdata', package='mapmisc')
     >
     > if(!exists('mapmiscCacheReadOnly'))
     + mapmiscCacheReadOnly = TRUE
     >
     >
     > options(
     + mapmiscCachePath = mapmiscCachePath,
     + mapmiscCacheReadOnly = mapmiscCacheReadOnly,
     + mapmiscVerbose=TRUE)
     >
     > getOption("mapmiscCachePath")
     [1] "/home/hornik/tmp/R.check/r-devel-clang/Work/build/Packages/mapmisc/extdata"
     > getOption("mapmiscCacheReadOnly")
     [1] TRUE
     > #'
     >
     >
     > #+ simplePlot
     > myraster = raster(matrix(0,10,10),xmn=8,xmx=18,ymn=0,ymx=10,
     + crs=CRS("+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0")
     + )
     > values(myraster) = seq(0,1,len=ncell(myraster))
     >
     > myPoints = SpatialPoints(myraster,
     + proj4string=CRS(proj4string(myraster)))[
     + seq(1,ncell(myraster),len=5)]
     >
     > plot(myraster)
     > points(myPoints)
     > #'
     > #'
     > #' only do the following if rgdal is available
     > #+ africaPlots
     > if(require('rgdal', quietly=TRUE)) {
     +
     + # utm zone 32
     + utmproj = CRS("+init=epsg:3064")
     + myrasterUTM = projectRaster(myraster, crs=utmproj)
     + myPointsUTM = spTransform(myPoints, utmproj)
     + plot(myrasterUTM)
     + points(myPointsUTM)
     +
     + myPointsMercator = spTransform(myPoints,
     + crsMerc)
     +
     +
     + myplot = function(first,second=first) {
     + par(mar=c(0,0,0,0))
     + plot(first)
     + plot(mytiles, add=TRUE)
     + plot(second,add=TRUE,col='blue')
     + # points(mycities,col='red')
     + # text(mycities, labels=mycities$name, col='red',pos=4)
     + scaleBar(first)
     + }
     +
     +
     + thezoom=6
     +
     + # only do the following if running unix (because nsl is available)
     + # and if the OpenStreetMap.org web site can be accessed
     +
     + # raster, result will be in project of the raster (long-lat)
     + mytiles = openmap(x=extend(myraster,1),
     + zoom=thezoom)
     + # mycities = GNcities(extend(myraster,1),max=5)
     + myplot(myraster, myPoints)
     +
     + # slash at the end
     + mytiles = openmap(extend(myraster,1),zoom=thezoom,
     + path="http://tile.openstreetmap.org/")
     + # mycities = GNcities(extend(myraster,1),max=5)
     + myplot(myraster, myPoints)
     +
     + # no http at beginning
     + mytiles = openmap(extend(myraster,1),path="tile.openstreetmap.org")
     + # mycities = GNcities(extend(myraster,1),max=5)
     + myplot(myraster, myPoints)
     +
     +
     + # extent, tiles will be long-lat
     + mytiles = openmap(extent(myraster),zoom=thezoom)
     + # cities will be long=lat
     + # mycities = GNcities(extent(myraster),max=5,lang="fr")
     + # myplot(mycities,myPoints)
     +
     + # give the bbox, long lat
     + mytiles = openmap(bbox(myraster),zoom=thezoom)
     + # mycities = GNcities(bbox(myraster),max=5)
     + # myplot(mycities,myPoints)
     +
     +
     + # give points, result is CRS of points (long-lat)
     + mytiles = openmap(myPoints,zoom=thezoom)
     + # mycities = GNcities(myPoints,max=5,lang="es")
     + myplot(myPoints)
     +
     + # UTM raster
     + mytiles = openmap(myrasterUTM,zoom=thezoom)
     + # mycities = GNcities(myrasterUTM,max=5)
     + myplot(myrasterUTM, myPointsUTM)
     +
     + # supply a crs
     + mytiles = openmap(x=extent(myrasterUTM),zoom=thezoom,
     + crs=proj4string(myrasterUTM))
     + # mycities = GNcities(myrasterUTM,max=5)
     + myplot(myrasterUTM, myPointsUTM)
     +
     + # utm points
     + mytiles = openmap(myPointsUTM,zoom=thezoom)
     + # mycities = GNcities(myPointsUTM,max=5)
     + myplot(myPointsUTM)
     +
     + # specify different output crs
     + mytiles = openmap(myPointsUTM, crs=CRS("+init=epsg:4326"))
     + # mycities = GNcities(myPoints,max=5)
     + myplot(myPoints)
     +
     + # one point only
     + mytiles = openmap(coordinates(myPoints)[1,], zoom=4)
     + myplot(myPoints)
     + } # end have rgdal
     rgdal: version: 1.4-7, (SVN revision 845)
     Geospatial Data Abstraction Library extensions to R successfully loaded
     Loaded GDAL runtime: GDAL 2.4.3, released 2019/10/28
     Path to GDAL shared files: /usr/share/gdal
     GDAL binary built with GEOS: TRUE
     Loaded PROJ.4 runtime: Rel. 6.2.1, November 1st, 2019, [PJ_VERSION: 621]
     Path to PROJ.4 shared files: (autodetected)
     Linking to sp version: 1.3-2
     zoom is 6 , 9 tiles
     http://tile.openstreetmap.org/
     http://tile.openstreetmap.org/
     tile /home/hornik/tmp/R.check/r-devel-clang/Work/build/Packages/mapmisc/extdata/org/6/33/30.png cached
     tile /home/hornik/tmp/R.check/r-devel-clang/Work/build/Packages/mapmisc/extdata/org/6/33/31.png cached
     tile /home/hornik/tmp/R.check/r-devel-clang/Work/build/Packages/mapmisc/extdata/org/6/33/32.png cached
     tile /home/hornik/tmp/R.check/r-devel-clang/Work/build/Packages/mapmisc/extdata/org/6/34/30.png cached
     tile /home/hornik/tmp/R.check/r-devel-clang/Work/build/Packages/mapmisc/extdata/org/6/34/31.png cached
     tile /home/hornik/tmp/R.check/r-devel-clang/Work/build/Packages/mapmisc/extdata/org/6/34/32.png cached
     tile /home/hornik/tmp/R.check/r-devel-clang/Work/build/Packages/mapmisc/extdata/org/6/35/30.png cached
     tile /home/hornik/tmp/R.check/r-devel-clang/Work/build/Packages/mapmisc/extdata/org/6/35/31.png cached
     tile /home/hornik/tmp/R.check/r-devel-clang/Work/build/Packages/mapmisc/extdata/org/6/35/32.png cached
     reprojecting 589824 cells... ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     mapmisc
     --- call from context ---
     openmap(x = extend(myraster, 1), zoom = thezoom)
     --- 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(x = extend(myraster, 1), zoom = thezoom)
    
     --- 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: 0x74412f0>
     <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
    Running the tests in 'tests/worldMap.R' failed.
    Complete output:
     > #+ setup
     > library('mapmisc')
     Loading required package: sp
     Loading required package: raster
     map images will be cached in /tmp/RtmpiSW1lB/mapmiscCache
     >
     > if(!exists('mapmiscCachePath'))
     + mapmiscCachePath = system.file('extdata', package='mapmisc')
     >
     > if(!exists('mapmiscCacheReadOnly'))
     + mapmiscCacheReadOnly = TRUE
     >
     > mapmiscCachePath
     [1] "/home/hornik/tmp/R.check/r-devel-clang/Work/build/Packages/mapmisc/extdata"
     >
     > options(
     + mapmiscCachePath = mapmiscCachePath,
     + mapmiscCacheReadOnly = mapmiscCacheReadOnly,
     + mapmiscVerbose=TRUE)
     >
     > getOption("mapmiscCachePath")
     [1] "/home/hornik/tmp/R.check/r-devel-clang/Work/build/Packages/mapmisc/extdata"
     > getOption("mapmiscCacheReadOnly")
     [1] TRUE
     > #'
     >
     >
     > #+ themaps, fig.cap='some maps', fig.subcap = c('projectable region', 'projected, with bg','projected, with world countries','projectable madagascar','madagascar')
     > Spackages = c('rgdal', 'rgeos', 'geosphere')
     >
     > if(all(unlist(mapply(requireNamespace, package=Spackages, MoreArgs=list(quietly=TRUE))))){
     + # library('rgdal')
     +
     + data("worldMap")
     +
     + world = spTransform(worldMap, crsLL)
     + country='Japan'
     + Dcountry = grep(country, world$NAME)
     + x=world[Dcountry,]
     +
     + myCrsO = moll(x, angle=25)
     +
     + plot(world)
     + plot(attributes(myCrsO)$regionLL,
     + border='red', col='#0000FF10', add=TRUE)
     +
     + myMap = openmap(myCrsO, zoom=1, fact=2)
     + map.new(myMap)
     + plot(myMap, add=TRUE)
     + gridlinesWrap(myCrsO, lty=2, col='orange')
     +
     + xTcrop = wrapPoly(x=world, crs=myCrsO)
     +
     + DcountryT = grep(country, xTcrop$NAME)
     +
     + map.new(xTcrop, buffer=1000*1000)
     + plot(attributes(myCrsO)$ellipse, add=TRUE, col='lightBlue', border='blue')
     + plot(xTcrop,add=TRUE, col='grey')
     + plot(xTcrop[DcountryT,], col='red', lty=0, add=TRUE)
     +
     + gridlinesWrap(myCrsO, lty=2, col='orange')
     +
     +
     + country='Madagascar'
     + Dcountry = grep(country, world$NAME)
     + x=world[Dcountry,]
     +
     + myCrsMoll = moll(x, angle=100, flip= 'nwu' )
     +
     + plot(attributes(myCrsMoll)$ellipse)
     +
     + plot(world)
     + plot(attributes(myCrsMoll)$crop, border='red', col='#0000FF10', add=TRUE)
     +
     + xTcrop = wrapPoly(x=world, crs=myCrsMoll)
     + DcountryT = grep(country, xTcrop$NAME)
     +
     + map.new(xTcrop)
     + plot(attributes(myCrsMoll)$ellipse, add=TRUE, col='lightBlue', border='blue')
     + plot(xTcrop,add=TRUE, col='grey')
     + plot(xTcrop[DcountryT,], col='green', add=TRUE)
     +
     + gridlinesWrap(crs=xTcrop, lty=2, col='red')
     +
     +
     +
     + country='Iceland'
     + Dcountry = grep(country, world$NAME)
     + x=world[Dcountry,]
     +
     + myCrsMoll = moll(x, angle=0, flip= 'nwu' )
     +
     + plot(attributes(myCrsMoll)$ellipse)
     +
     + plot(world)
     + plot(attributes(myCrsMoll)$crop, border='red', col='#0000FF10', add=TRUE)
     +
     + xTcrop = wrapPoly(x=world, crs=myCrsMoll)
     + DcountryT = grep(country, xTcrop$NAME)
     +
     + map.new(xTcrop)
     + plot(attributes(myCrsMoll)$ellipse, add=TRUE, col='lightBlue', border='blue')
     + plot(xTcrop,add=TRUE, col='grey')
     + plot(xTcrop[DcountryT,], col='green', add=TRUE)
     +
     + gridlinesWrap(crs=xTcrop, lty=2, col='red')
     +
     +
     + }
     zoom is 1 , 4 tiles
     http://tile.openstreetmap.org/
     http://tile.openstreetmap.org/
     tile /home/hornik/tmp/R.check/r-devel-clang/Work/build/Packages/mapmisc/extdata/org/1/0/0.png cached
     tile /home/hornik/tmp/R.check/r-devel-clang/Work/build/Packages/mapmisc/extdata/org/1/0/1.png cached
     tile /home/hornik/tmp/R.check/r-devel-clang/Work/build/Packages/mapmisc/extdata/org/1/1/0.png cached
     tile /home/hornik/tmp/R.check/r-devel-clang/Work/build/Packages/mapmisc/extdata/org/1/1/1.png cached
     reprojecting 262144 cells... ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     mapmisc
     --- call from context ---
     openmap(myCrsO, zoom = 1, fact = 2)
     --- 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(myCrsO, zoom = 1, fact = 2)
    
     --- 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: 0x9aa4aa8>
     <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
Flavor: r-devel-linux-x86_64-debian-clang

Version: 1.7.5
Check: re-building of vignette outputs
Result: WARN
    Error(s) in re-building vignettes:
     ...
    --- re-building 'mapmisc.Rnw' using knitr
    Loading required package: sp
    Loading required package: raster
    map images will be cached in /tmp/RtmpeaoM8b/mapmiscCache
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
    :
     --- package (from environment) ---
    mapmisc
     --- call from context ---
    openmap(meuse)
     --- 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(meuse)
    where 2: eval(expr, envir, enclos)
    where 3: eval(expr, envir, enclos)
    where 4: withVisible(eval(expr, envir, enclos))
    where 5: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler,
     error = eHandler, message = mHandler)
    where 6: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir,
     enclos)), warning = wHandler, error = eHandler, message = mHandler))
    where 7: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr,
     envir, enclos)), warning = wHandler, error = eHandler, message = mHandler)))
    where 8: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos,
     debug = debug, last = i == length(out), use_try = stop_on_error !=
     2L, keep_warning = keep_warning, keep_message = keep_message,
     output_handler = output_handler, include_timing = include_timing)
    where 9: evaluate::evaluate(...)
    where 10: evaluate(code, envir = env, new_device = FALSE, keep_warning = !isFALSE(options$warning),
     keep_message = !isFALSE(options$message), stop_on_error = if (options$error &&
     options$include) 0L else 2L, output_handler = knit_handlers(options$render,
     options))
    where 11: in_dir(input_dir(), evaluate(code, envir = env, new_device = FALSE,
     keep_warning = !isFALSE(options$warning), keep_message = !isFALSE(options$message),
     stop_on_error = if (options$error && options$include) 0L else 2L,
     output_handler = knit_handlers(options$render, options)))
    where 12: block_exec(params)
    where 13: call_block(x)
    where 14: process_group.block(group)
    where 15: process_group(group)
    where 16: withCallingHandlers(if (tangle) process_tangle(group) else process_group(group),
     error = function(e) {
     setwd(wd)
     cat(res, sep = "\n", file = output %n% "")
     message("Quitting from lines ", paste(current_lines(i),
     collapse = "-"), " (", knit_concord$get("infile"),
     ") ")
     })
    where 17: process_file(text, output)
    where 18: (if (grepl("\\.[Rr]md$", file)) knit2html_v1 else if (grepl("\\.[Rr]rst$",
     file)) knit2pandoc else knit)(file, encoding = encoding,
     quiet = quiet, envir = globalenv(), ...)
    where 19: engine$weave(file, quiet = quiet, encoding = enc)
    where 20: doTryCatch(return(expr), name, parentenv, handler)
    where 21: tryCatchOne(expr, names, parentenv, handlers[[1L]])
    where 22: tryCatchList(expr, classes, parentenv, handlers)
    where 23: tryCatch({
     engine$weave(file, quiet = quiet, encoding = enc)
     setwd(startdir)
     output <- find_vignette_product(name, by = "weave", engine = engine)
     if (!have.makefile && vignette_is_tex(output)) {
     texi2pdf(file = output, clean = FALSE, quiet = quiet)
     output <- find_vignette_product(name, by = "texi2pdf",
     engine = engine)
     }
    }, error = function(e) {
     OK <<- FALSE
     message(gettextf("Error: processing vignette '%s' failed with diagnostics:\n%s",
     file, conditionMessage(e)))
    })
    where 24: tools:::.buildOneVignette("mapmisc.Rnw", "/home/hornik/tmp/R.check/r-devel-clang/Work/PKGS/mapmisc.Rcheck/vign_test/mapmisc",
     TRUE, TRUE, "mapmisc", "", "/tmp/RtmpyifxLk/file312e28f3494d.rds")
    
     --- 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: 0xa9cc5b8>
    <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
    --- re-building 'north.Rmd' using docco_linear
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
    :
     --- package (from environment) ---
    mapmisc
     --- call from context ---
    openmap(x, path = "osm-no-labels", maxTiles = 12, buffer = c(30,
     3), fact = fact)
     --- 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 at <text>#2: openmap(x, path = "osm-no-labels", maxTiles = 12, buffer = c(30,
     3), fact = fact)
    where 2: eval(expr, envir, enclos)
    where 3: eval(expr, envir, enclos)
    where 4: withVisible(eval(expr, envir, enclos))
    where 5: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler,
     error = eHandler, message = mHandler)
    where 6: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir,
     enclos)), warning = wHandler, error = eHandler, message = mHandler))
    where 7: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr,
     envir, enclos)), warning = wHandler, error = eHandler, message = mHandler)))
    where 8: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos,
     debug = debug, last = i == length(out), use_try = stop_on_error !=
     2L, keep_warning = keep_warning, keep_message = keep_message,
     output_handler = output_handler, include_timing = include_timing)
    where 9: evaluate::evaluate(...)
    where 10: evaluate(code, envir = env, new_device = FALSE, keep_warning = !isFALSE(options$warning),
     keep_message = !isFALSE(options$message), stop_on_error = if (options$error &&
     options$include) 0L else 2L, output_handler = knit_handlers(options$render,
     options))
    where 11: in_dir(input_dir(), evaluate(code, envir = env, new_device = FALSE,
     keep_warning = !isFALSE(options$warning), keep_message = !isFALSE(options$message),
     stop_on_error = if (options$error && options$include) 0L else 2L,
     output_handler = knit_handlers(options$render, options)))
    where 12: block_exec(params)
    where 13: call_block(x)
    where 14: process_group.block(group)
    where 15: process_group(group)
    where 16: withCallingHandlers(if (tangle) process_tangle(group) else process_group(group),
     error = function(e) {
     setwd(wd)
     cat(res, sep = "\n", file = output %n% "")
     message("Quitting from lines ", paste(current_lines(i),
     collapse = "-"), " (", knit_concord$get("infile"),
     ") ")
     })
    where 17: process_file(text, output)
    where 18: knit(input, text = text, envir = envir, quiet = quiet)
    where 19: knit2html(file, encoding = encoding, quiet = quiet, envir = globalenv(),
     template = system.file("misc", "docco-template.html", package = "knitr"),
     ...)
    where 20: engine$weave(file, quiet = quiet, encoding = enc)
    where 21: doTryCatch(return(expr), name, parentenv, handler)
    where 22: tryCatchOne(expr, names, parentenv, handlers[[1L]])
    where 23: tryCatchList(expr, classes, parentenv, handlers)
    where 24: tryCatch({
     engine$weave(file, quiet = quiet, encoding = enc)
     setwd(startdir)
     output <- find_vignette_product(name, by = "weave", engine = engine)
     if (!have.makefile && vignette_is_tex(output)) {
     texi2pdf(file = output, clean = FALSE, quiet = quiet)
     output <- find_vignette_product(name, by = "texi2pdf",
     engine = engine)
     }
    }, error = function(e) {
     OK <<- FALSE
     message(gettextf("Error: processing vignette '%s' failed with diagnostics:\n%s",
     file, conditionMessage(e)))
    })
    where 25: tools:::.buildOneVignette("north.Rmd", "/home/hornik/tmp/R.check/r-devel-clang/Work/PKGS/mapmisc.Rcheck/vign_test/mapmisc",
     TRUE, TRUE, "north", "", "/tmp/RtmpyifxLk/file312e58b4d976.rds")
    
     --- 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: 0x8e46fd8>
    <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
    make[1]: Entering directory '/home/hornik/tmp/R.check/r-devel-clang/Work/PKGS/mapmisc.Rcheck/vign_test/mapmisc/vignettes'
    R --slave -e "knitr::knit('north.Rmd')" fact=2
    ARGUMENT 'fact=2' __ignored__
    
    
    
    processing file: north.Rmd
     ordinary text without R code
    
    label: setup (with options)
    List of 1
     $ include: logi FALSE
    
     ordinary text without R code
    
    label: mapmiscCache (with options)
    List of 1
     $ purl: logi FALSE
    
     ordinary text without R code
    
    label: data
     ordinary text without R code
    
    label: osm
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
    :
     --- package (from environment) ---
    mapmisc
     --- call from context ---
    openmap(x, path = "osm-no-labels", maxTiles = 12, buffer = c(30,
     3), fact = fact)
     --- 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 at <text>#2: openmap(x, path = "osm-no-labels", maxTiles = 12, buffer = c(30,
     3), fact = fact)
    where 2: eval(expr, envir, enclos)
    where 3: eval(expr, envir, enclos)
    where 4: withVisible(eval(expr, envir, enclos))
    where 5: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler,
     error = eHandler, message = mHandler)
    where 6: doTryCatch(return(expr), name, parentenv, handler)
    where 7: tryCatchOne(expr, names, parentenv, handlers[[1L]])
    where 8: tryCatchList(expr, classes, parentenv, handlers)
    where 9: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
    })
    where 10: try(f, silent = TRUE)
    where 11: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir,
     enclos)), warning = wHandler, error = eHandler, message = mHandler))
    where 12: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr,
     envir, enclos)), warning = wHandler, error = eHandler, message = mHandler)))
    where 13: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos,
     debug = debug, last = i == length(out), use_try = stop_on_error !=
     2L, keep_warning = keep_warning, keep_message = keep_message,
     output_handler = output_handler, include_timing = include_timing)
    where 14: evaluate::evaluate(...)
    where 15: evaluate(code, envir = env, new_device = FALSE, keep_warning = !isFALSE(options$warning),
     keep_message = !isFALSE(options$message), stop_on_error = if (options$error &&
     options$include) 0L else 2L, output_handler = knit_handlers(options$render,
     options))
    where 16: in_dir(input_dir(), evaluate(code, envir = env, new_device = FALSE,
     keep_warning = !isFALSE(options$warning), keep_message = !isFALSE(options$message),
     stop_on_error = if (options$error && options$include) 0L else 2L,
     output_handler = knit_handlers(options$render, options)))
    where 17: block_exec(params)
    where 18: call_block(x)
    where 19: process_group.block(group)
    where 20: process_group(group)
    where 21: withCallingHandlers(if (tangle) process_tangle(group) else process_group(group),
     error = function(e) {
     setwd(wd)
     cat(res, sep = "\n", file = output %n% "")
     message("Quitting from lines ", paste(current_lines(i),
     collapse = "-"), " (", knit_concord$get("infile"),
     ") ")
     })
    where 22: process_file(text, output)
    where 23: knitr::knit("north.Rmd")
    
     --- 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: 0x9cf0de8>
    <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
    make[1]: *** [Makefile:15: north.md] Error 2
    make[1]: Leaving directory '/home/hornik/tmp/R.check/r-devel-clang/Work/PKGS/mapmisc.Rcheck/vign_test/mapmisc/vignettes'
    Error in tools:::buildVignettes(dir = "/home/hornik/tmp/R.check/r-devel-clang/Work/PKGS/mapmisc.Rcheck/vign_test/mapmisc", :
     running 'make' failed
    Execution halted
Flavor: r-devel-linux-x86_64-debian-clang

Version: 1.7.5
Check: examples
Result: ERROR
    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: 0x562870849a50>
    <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
Flavor: r-devel-linux-x86_64-debian-gcc

Version: 1.7.5
Check: tests
Result: ERROR
     Running ‘colourScale.R’ [3s/4s]
     Running ‘omerc.R’ [9s/13s]
     Running ‘openmap.R’ [8s/12s]
     Running ‘worldMap.R’ [11s/14s]
    Running the tests in ‘tests/openmap.R’ failed.
    Complete output:
     > #+ setup
     > library('mapmisc')
     Loading required package: sp
     Loading required package: raster
     map images will be cached in /home/hornik/tmp/scratch/RtmpTXjp4v/mapmiscCache
     >
     > if(!exists('mapmiscCachePath'))
     + mapmiscCachePath = system.file('extdata', package='mapmisc')
     >
     > if(!exists('mapmiscCacheReadOnly'))
     + mapmiscCacheReadOnly = TRUE
     >
     >
     > options(
     + mapmiscCachePath = mapmiscCachePath,
     + mapmiscCacheReadOnly = mapmiscCacheReadOnly,
     + mapmiscVerbose=TRUE)
     >
     > getOption("mapmiscCachePath")
     [1] "/home/hornik/tmp/R.check/r-devel-gcc/Work/build/Packages/mapmisc/extdata"
     > getOption("mapmiscCacheReadOnly")
     [1] TRUE
     > #'
     >
     >
     > #+ simplePlot
     > myraster = raster(matrix(0,10,10),xmn=8,xmx=18,ymn=0,ymx=10,
     + crs=CRS("+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0")
     + )
     > values(myraster) = seq(0,1,len=ncell(myraster))
     >
     > myPoints = SpatialPoints(myraster,
     + proj4string=CRS(proj4string(myraster)))[
     + seq(1,ncell(myraster),len=5)]
     >
     > plot(myraster)
     > points(myPoints)
     > #'
     > #'
     > #' only do the following if rgdal is available
     > #+ africaPlots
     > if(require('rgdal', quietly=TRUE)) {
     +
     + # utm zone 32
     + utmproj = CRS("+init=epsg:3064")
     + myrasterUTM = projectRaster(myraster, crs=utmproj)
     + myPointsUTM = spTransform(myPoints, utmproj)
     + plot(myrasterUTM)
     + points(myPointsUTM)
     +
     + myPointsMercator = spTransform(myPoints,
     + crsMerc)
     +
     +
     + myplot = function(first,second=first) {
     + par(mar=c(0,0,0,0))
     + plot(first)
     + plot(mytiles, add=TRUE)
     + plot(second,add=TRUE,col='blue')
     + # points(mycities,col='red')
     + # text(mycities, labels=mycities$name, col='red',pos=4)
     + scaleBar(first)
     + }
     +
     +
     + thezoom=6
     +
     + # only do the following if running unix (because nsl is available)
     + # and if the OpenStreetMap.org web site can be accessed
     +
     + # raster, result will be in project of the raster (long-lat)
     + mytiles = openmap(x=extend(myraster,1),
     + zoom=thezoom)
     + # mycities = GNcities(extend(myraster,1),max=5)
     + myplot(myraster, myPoints)
     +
     + # slash at the end
     + mytiles = openmap(extend(myraster,1),zoom=thezoom,
     + path="http://tile.openstreetmap.org/")
     + # mycities = GNcities(extend(myraster,1),max=5)
     + myplot(myraster, myPoints)
     +
     + # no http at beginning
     + mytiles = openmap(extend(myraster,1),path="tile.openstreetmap.org")
     + # mycities = GNcities(extend(myraster,1),max=5)
     + myplot(myraster, myPoints)
     +
     +
     + # extent, tiles will be long-lat
     + mytiles = openmap(extent(myraster),zoom=thezoom)
     + # cities will be long=lat
     + # mycities = GNcities(extent(myraster),max=5,lang="fr")
     + # myplot(mycities,myPoints)
     +
     + # give the bbox, long lat
     + mytiles = openmap(bbox(myraster),zoom=thezoom)
     + # mycities = GNcities(bbox(myraster),max=5)
     + # myplot(mycities,myPoints)
     +
     +
     + # give points, result is CRS of points (long-lat)
     + mytiles = openmap(myPoints,zoom=thezoom)
     + # mycities = GNcities(myPoints,max=5,lang="es")
     + myplot(myPoints)
     +
     + # UTM raster
     + mytiles = openmap(myrasterUTM,zoom=thezoom)
     + # mycities = GNcities(myrasterUTM,max=5)
     + myplot(myrasterUTM, myPointsUTM)
     +
     + # supply a crs
     + mytiles = openmap(x=extent(myrasterUTM),zoom=thezoom,
     + crs=proj4string(myrasterUTM))
     + # mycities = GNcities(myrasterUTM,max=5)
     + myplot(myrasterUTM, myPointsUTM)
     +
     + # utm points
     + mytiles = openmap(myPointsUTM,zoom=thezoom)
     + # mycities = GNcities(myPointsUTM,max=5)
     + myplot(myPointsUTM)
     +
     + # specify different output crs
     + mytiles = openmap(myPointsUTM, crs=CRS("+init=epsg:4326"))
     + # mycities = GNcities(myPoints,max=5)
     + myplot(myPoints)
     +
     + # one point only
     + mytiles = openmap(coordinates(myPoints)[1,], zoom=4)
     + myplot(myPoints)
     + } # end have rgdal
     rgdal: version: 1.4-7, (SVN revision 845)
     Geospatial Data Abstraction Library extensions to R successfully loaded
     Loaded GDAL runtime: GDAL 2.4.3, released 2019/10/28
     Path to GDAL shared files: /usr/share/gdal
     GDAL binary built with GEOS: TRUE
     Loaded PROJ.4 runtime: Rel. 6.2.1, November 1st, 2019, [PJ_VERSION: 621]
     Path to PROJ.4 shared files: (autodetected)
     Linking to sp version: 1.3-2
     zoom is 6 , 9 tiles
     http://tile.openstreetmap.org/
     http://tile.openstreetmap.org/
     tile /home/hornik/tmp/R.check/r-devel-gcc/Work/build/Packages/mapmisc/extdata/org/6/33/30.png cached
     tile /home/hornik/tmp/R.check/r-devel-gcc/Work/build/Packages/mapmisc/extdata/org/6/33/31.png cached
     tile /home/hornik/tmp/R.check/r-devel-gcc/Work/build/Packages/mapmisc/extdata/org/6/33/32.png cached
     tile /home/hornik/tmp/R.check/r-devel-gcc/Work/build/Packages/mapmisc/extdata/org/6/34/30.png cached
     tile /home/hornik/tmp/R.check/r-devel-gcc/Work/build/Packages/mapmisc/extdata/org/6/34/31.png cached
     tile /home/hornik/tmp/R.check/r-devel-gcc/Work/build/Packages/mapmisc/extdata/org/6/34/32.png cached
     tile /home/hornik/tmp/R.check/r-devel-gcc/Work/build/Packages/mapmisc/extdata/org/6/35/30.png cached
     tile /home/hornik/tmp/R.check/r-devel-gcc/Work/build/Packages/mapmisc/extdata/org/6/35/31.png cached
     tile /home/hornik/tmp/R.check/r-devel-gcc/Work/build/Packages/mapmisc/extdata/org/6/35/32.png cached
     reprojecting 589824 cells... ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     mapmisc
     --- call from context ---
     openmap(x = extend(myraster, 1), zoom = thezoom)
     --- 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(x = extend(myraster, 1), zoom = thezoom)
    
     --- 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: 0x5571f98f82c0>
     <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
    Running the tests in ‘tests/worldMap.R’ failed.
    Complete output:
     > #+ setup
     > library('mapmisc')
     Loading required package: sp
     Loading required package: raster
     map images will be cached in /home/hornik/tmp/scratch/Rtmpp5MPML/mapmiscCache
     >
     > if(!exists('mapmiscCachePath'))
     + mapmiscCachePath = system.file('extdata', package='mapmisc')
     >
     > if(!exists('mapmiscCacheReadOnly'))
     + mapmiscCacheReadOnly = TRUE
     >
     > mapmiscCachePath
     [1] "/home/hornik/tmp/R.check/r-devel-gcc/Work/build/Packages/mapmisc/extdata"
     >
     > options(
     + mapmiscCachePath = mapmiscCachePath,
     + mapmiscCacheReadOnly = mapmiscCacheReadOnly,
     + mapmiscVerbose=TRUE)
     >
     > getOption("mapmiscCachePath")
     [1] "/home/hornik/tmp/R.check/r-devel-gcc/Work/build/Packages/mapmisc/extdata"
     > getOption("mapmiscCacheReadOnly")
     [1] TRUE
     > #'
     >
     >
     > #+ themaps, fig.cap='some maps', fig.subcap = c('projectable region', 'projected, with bg','projected, with world countries','projectable madagascar','madagascar')
     > Spackages = c('rgdal', 'rgeos', 'geosphere')
     >
     > if(all(unlist(mapply(requireNamespace, package=Spackages, MoreArgs=list(quietly=TRUE))))){
     + # library('rgdal')
     +
     + data("worldMap")
     +
     + world = spTransform(worldMap, crsLL)
     + country='Japan'
     + Dcountry = grep(country, world$NAME)
     + x=world[Dcountry,]
     +
     + myCrsO = moll(x, angle=25)
     +
     + plot(world)
     + plot(attributes(myCrsO)$regionLL,
     + border='red', col='#0000FF10', add=TRUE)
     +
     + myMap = openmap(myCrsO, zoom=1, fact=2)
     + map.new(myMap)
     + plot(myMap, add=TRUE)
     + gridlinesWrap(myCrsO, lty=2, col='orange')
     +
     + xTcrop = wrapPoly(x=world, crs=myCrsO)
     +
     + DcountryT = grep(country, xTcrop$NAME)
     +
     + map.new(xTcrop, buffer=1000*1000)
     + plot(attributes(myCrsO)$ellipse, add=TRUE, col='lightBlue', border='blue')
     + plot(xTcrop,add=TRUE, col='grey')
     + plot(xTcrop[DcountryT,], col='red', lty=0, add=TRUE)
     +
     + gridlinesWrap(myCrsO, lty=2, col='orange')
     +
     +
     + country='Madagascar'
     + Dcountry = grep(country, world$NAME)
     + x=world[Dcountry,]
     +
     + myCrsMoll = moll(x, angle=100, flip= 'nwu' )
     +
     + plot(attributes(myCrsMoll)$ellipse)
     +
     + plot(world)
     + plot(attributes(myCrsMoll)$crop, border='red', col='#0000FF10', add=TRUE)
     +
     + xTcrop = wrapPoly(x=world, crs=myCrsMoll)
     + DcountryT = grep(country, xTcrop$NAME)
     +
     + map.new(xTcrop)
     + plot(attributes(myCrsMoll)$ellipse, add=TRUE, col='lightBlue', border='blue')
     + plot(xTcrop,add=TRUE, col='grey')
     + plot(xTcrop[DcountryT,], col='green', add=TRUE)
     +
     + gridlinesWrap(crs=xTcrop, lty=2, col='red')
     +
     +
     +
     + country='Iceland'
     + Dcountry = grep(country, world$NAME)
     + x=world[Dcountry,]
     +
     + myCrsMoll = moll(x, angle=0, flip= 'nwu' )
     +
     + plot(attributes(myCrsMoll)$ellipse)
     +
     + plot(world)
     + plot(attributes(myCrsMoll)$crop, border='red', col='#0000FF10', add=TRUE)
     +
     + xTcrop = wrapPoly(x=world, crs=myCrsMoll)
     + DcountryT = grep(country, xTcrop$NAME)
     +
     + map.new(xTcrop)
     + plot(attributes(myCrsMoll)$ellipse, add=TRUE, col='lightBlue', border='blue')
     + plot(xTcrop,add=TRUE, col='grey')
     + plot(xTcrop[DcountryT,], col='green', add=TRUE)
     +
     + gridlinesWrap(crs=xTcrop, lty=2, col='red')
     +
     +
     + }
     zoom is 1 , 4 tiles
     http://tile.openstreetmap.org/
     http://tile.openstreetmap.org/
     tile /home/hornik/tmp/R.check/r-devel-gcc/Work/build/Packages/mapmisc/extdata/org/1/0/0.png cached
     tile /home/hornik/tmp/R.check/r-devel-gcc/Work/build/Packages/mapmisc/extdata/org/1/0/1.png cached
     tile /home/hornik/tmp/R.check/r-devel-gcc/Work/build/Packages/mapmisc/extdata/org/1/1/0.png cached
     tile /home/hornik/tmp/R.check/r-devel-gcc/Work/build/Packages/mapmisc/extdata/org/1/1/1.png cached
     reprojecting 262144 cells... ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     mapmisc
     --- call from context ---
     openmap(myCrsO, zoom = 1, fact = 2)
     --- 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(myCrsO, zoom = 1, fact = 2)
    
     --- 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: 0x55b88a591250>
     <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
Flavor: r-devel-linux-x86_64-debian-gcc

Version: 1.7.5
Check: re-building of vignette outputs
Result: WARN
    Error(s) in re-building vignettes:
     ...
    --- re-building ‘mapmisc.Rnw’ using knitr
    Loading required package: sp
    Loading required package: raster
    map images will be cached in /home/hornik/tmp/scratch/RtmpNI54CF/mapmiscCache
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
    :
     --- package (from environment) ---
    mapmisc
     --- call from context ---
    openmap(meuse)
     --- 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(meuse)
    where 2: eval(expr, envir, enclos)
    where 3: eval(expr, envir, enclos)
    where 4: withVisible(eval(expr, envir, enclos))
    where 5: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler,
     error = eHandler, message = mHandler)
    where 6: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir,
     enclos)), warning = wHandler, error = eHandler, message = mHandler))
    where 7: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr,
     envir, enclos)), warning = wHandler, error = eHandler, message = mHandler)))
    where 8: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos,
     debug = debug, last = i == length(out), use_try = stop_on_error !=
     2L, keep_warning = keep_warning, keep_message = keep_message,
     output_handler = output_handler, include_timing = include_timing)
    where 9: evaluate::evaluate(...)
    where 10: evaluate(code, envir = env, new_device = FALSE, keep_warning = !isFALSE(options$warning),
     keep_message = !isFALSE(options$message), stop_on_error = if (options$error &&
     options$include) 0L else 2L, output_handler = knit_handlers(options$render,
     options))
    where 11: in_dir(input_dir(), evaluate(code, envir = env, new_device = FALSE,
     keep_warning = !isFALSE(options$warning), keep_message = !isFALSE(options$message),
     stop_on_error = if (options$error && options$include) 0L else 2L,
     output_handler = knit_handlers(options$render, options)))
    where 12: block_exec(params)
    where 13: call_block(x)
    where 14: process_group.block(group)
    where 15: process_group(group)
    where 16: withCallingHandlers(if (tangle) process_tangle(group) else process_group(group),
     error = function(e) {
     setwd(wd)
     cat(res, sep = "\n", file = output %n% "")
     message("Quitting from lines ", paste(current_lines(i),
     collapse = "-"), " (", knit_concord$get("infile"),
     ") ")
     })
    where 17: process_file(text, output)
    where 18: (if (grepl("\\.[Rr]md$", file)) knit2html_v1 else if (grepl("\\.[Rr]rst$",
     file)) knit2pandoc else knit)(file, encoding = encoding,
     quiet = quiet, envir = globalenv(), ...)
    where 19: engine$weave(file, quiet = quiet, encoding = enc)
    where 20: doTryCatch(return(expr), name, parentenv, handler)
    where 21: tryCatchOne(expr, names, parentenv, handlers[[1L]])
    where 22: tryCatchList(expr, classes, parentenv, handlers)
    where 23: tryCatch({
     engine$weave(file, quiet = quiet, encoding = enc)
     setwd(startdir)
     output <- find_vignette_product(name, by = "weave", engine = engine)
     if (!have.makefile && vignette_is_tex(output)) {
     texi2pdf(file = output, clean = FALSE, quiet = quiet)
     output <- find_vignette_product(name, by = "texi2pdf",
     engine = engine)
     }
    }, error = function(e) {
     OK <<- FALSE
     message(gettextf("Error: processing vignette '%s' failed with diagnostics:\n%s",
     file, conditionMessage(e)))
    })
    where 24: tools:::.buildOneVignette("mapmisc.Rnw", "/home/hornik/tmp/R.check/r-devel-gcc/Work/PKGS/mapmisc.Rcheck/vign_test/mapmisc",
     TRUE, TRUE, "mapmisc", "", "/home/hornik/tmp/scratch/RtmpWep5OS/file614637181187.rds")
    
     --- 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: 0x55c7397b67e0>
    <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
    --- re-building ‘north.Rmd’ using docco_linear
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
    :
     --- package (from environment) ---
    mapmisc
     --- call from context ---
    openmap(x, path = "osm-no-labels", maxTiles = 12, buffer = c(30,
     3), fact = fact)
     --- 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 at <text>#2: openmap(x, path = "osm-no-labels", maxTiles = 12, buffer = c(30,
     3), fact = fact)
    where 2: eval(expr, envir, enclos)
    where 3: eval(expr, envir, enclos)
    where 4: withVisible(eval(expr, envir, enclos))
    where 5: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler,
     error = eHandler, message = mHandler)
    where 6: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir,
     enclos)), warning = wHandler, error = eHandler, message = mHandler))
    where 7: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr,
     envir, enclos)), warning = wHandler, error = eHandler, message = mHandler)))
    where 8: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos,
     debug = debug, last = i == length(out), use_try = stop_on_error !=
     2L, keep_warning = keep_warning, keep_message = keep_message,
     output_handler = output_handler, include_timing = include_timing)
    where 9: evaluate::evaluate(...)
    where 10: evaluate(code, envir = env, new_device = FALSE, keep_warning = !isFALSE(options$warning),
     keep_message = !isFALSE(options$message), stop_on_error = if (options$error &&
     options$include) 0L else 2L, output_handler = knit_handlers(options$render,
     options))
    where 11: in_dir(input_dir(), evaluate(code, envir = env, new_device = FALSE,
     keep_warning = !isFALSE(options$warning), keep_message = !isFALSE(options$message),
     stop_on_error = if (options$error && options$include) 0L else 2L,
     output_handler = knit_handlers(options$render, options)))
    where 12: block_exec(params)
    where 13: call_block(x)
    where 14: process_group.block(group)
    where 15: process_group(group)
    where 16: withCallingHandlers(if (tangle) process_tangle(group) else process_group(group),
     error = function(e) {
     setwd(wd)
     cat(res, sep = "\n", file = output %n% "")
     message("Quitting from lines ", paste(current_lines(i),
     collapse = "-"), " (", knit_concord$get("infile"),
     ") ")
     })
    where 17: process_file(text, output)
    where 18: knit(input, text = text, envir = envir, quiet = quiet)
    where 19: knit2html(file, encoding = encoding, quiet = quiet, envir = globalenv(),
     template = system.file("misc", "docco-template.html", package = "knitr"),
     ...)
    where 20: engine$weave(file, quiet = quiet, encoding = enc)
    where 21: doTryCatch(return(expr), name, parentenv, handler)
    where 22: tryCatchOne(expr, names, parentenv, handlers[[1L]])
    where 23: tryCatchList(expr, classes, parentenv, handlers)
    where 24: tryCatch({
     engine$weave(file, quiet = quiet, encoding = enc)
     setwd(startdir)
     output <- find_vignette_product(name, by = "weave", engine = engine)
     if (!have.makefile && vignette_is_tex(output)) {
     texi2pdf(file = output, clean = FALSE, quiet = quiet)
     output <- find_vignette_product(name, by = "texi2pdf",
     engine = engine)
     }
    }, error = function(e) {
     OK <<- FALSE
     message(gettextf("Error: processing vignette '%s' failed with diagnostics:\n%s",
     file, conditionMessage(e)))
    })
    where 25: tools:::.buildOneVignette("north.Rmd", "/home/hornik/tmp/R.check/r-devel-gcc/Work/PKGS/mapmisc.Rcheck/vign_test/mapmisc",
     TRUE, TRUE, "north", "", "/home/hornik/tmp/scratch/RtmpWep5OS/file614671406480.rds")
    
     --- 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: 0x564ab08d5bc8>
    <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
    make[1]: Entering directory '/home/hornik/tmp/R.check/r-devel-gcc/Work/PKGS/mapmisc.Rcheck/vign_test/mapmisc/vignettes'
    R --slave -e "knitr::knit('north.Rmd')" fact=2
    ARGUMENT 'fact=2' __ignored__
    
    
    
    processing file: north.Rmd
     ordinary text without R code
    
    label: setup (with options)
    List of 1
     $ include: logi FALSE
    
     ordinary text without R code
    
    label: mapmiscCache (with options)
    List of 1
     $ purl: logi FALSE
    
     ordinary text without R code
    
    label: data
     ordinary text without R code
    
    label: osm
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
    :
     --- package (from environment) ---
    mapmisc
     --- call from context ---
    openmap(x, path = "osm-no-labels", maxTiles = 12, buffer = c(30,
     3), fact = fact)
     --- 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 at <text>#2: openmap(x, path = "osm-no-labels", maxTiles = 12, buffer = c(30,
     3), fact = fact)
    where 2: eval(expr, envir, enclos)
    where 3: eval(expr, envir, enclos)
    where 4: withVisible(eval(expr, envir, enclos))
    where 5: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler,
     error = eHandler, message = mHandler)
    where 6: doTryCatch(return(expr), name, parentenv, handler)
    where 7: tryCatchOne(expr, names, parentenv, handlers[[1L]])
    where 8: tryCatchList(expr, classes, parentenv, handlers)
    where 9: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
    })
    where 10: try(f, silent = TRUE)
    where 11: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir,
     enclos)), warning = wHandler, error = eHandler, message = mHandler))
    where 12: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr,
     envir, enclos)), warning = wHandler, error = eHandler, message = mHandler)))
    where 13: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos,
     debug = debug, last = i == length(out), use_try = stop_on_error !=
     2L, keep_warning = keep_warning, keep_message = keep_message,
     output_handler = output_handler, include_timing = include_timing)
    where 14: evaluate::evaluate(...)
    where 15: evaluate(code, envir = env, new_device = FALSE, keep_warning = !isFALSE(options$warning),
     keep_message = !isFALSE(options$message), stop_on_error = if (options$error &&
     options$include) 0L else 2L, output_handler = knit_handlers(options$render,
     options))
    where 16: in_dir(input_dir(), evaluate(code, envir = env, new_device = FALSE,
     keep_warning = !isFALSE(options$warning), keep_message = !isFALSE(options$message),
     stop_on_error = if (options$error && options$include) 0L else 2L,
     output_handler = knit_handlers(options$render, options)))
    where 17: block_exec(params)
    where 18: call_block(x)
    where 19: process_group.block(group)
    where 20: process_group(group)
    where 21: withCallingHandlers(if (tangle) process_tangle(group) else process_group(group),
     error = function(e) {
     setwd(wd)
     cat(res, sep = "\n", file = output %n% "")
     message("Quitting from lines ", paste(current_lines(i),
     collapse = "-"), " (", knit_concord$get("infile"),
     ") ")
     })
    where 22: process_file(text, output)
    where 23: knitr::knit("north.Rmd")
    
     --- 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: 0x557d89c2fd90>
    <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
    make[1]: *** [Makefile:15: north.md] Error 2
    make[1]: Leaving directory '/home/hornik/tmp/R.check/r-devel-gcc/Work/PKGS/mapmisc.Rcheck/vign_test/mapmisc/vignettes'
    Error in tools:::buildVignettes(dir = "/home/hornik/tmp/R.check/r-devel-gcc/Work/PKGS/mapmisc.Rcheck/vign_test/mapmisc", :
     running ‘make’ failed
    Execution halted
Flavor: r-devel-linux-x86_64-debian-gcc

Version: 1.7.5
Check: data for non-ASCII characters
Result: NOTE
     Note: found 1 marked UTF-8 string
Flavors: r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc, r-patched-solaris-x86, r-release-osx-x86_64, r-oldrel-osx-x86_64